patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Kevin Traynor <ktraynor@redhat.com>
Cc: dev <dev@dpdk.org>, Nithin Dabilpuram <ndabilpuram@marvell.com>,
	dpdk stable <stable@dpdk.org>,
	anoobj@marvell.com
Subject: Re: [dpdk-stable] [PATCH 2/9] crypto/octeontx: fix possible NULL deference
Date: Wed, 30 Oct 2019 08:56:18 +0100	[thread overview]
Message-ID: <CAJFAV8zb837kAAY9iS=Z2r1vt8uvFrk3CVrV0VoYCUQ+SWij_Q@mail.gmail.com> (raw)
In-Reply-To: <20191001130405.7076-1-ktraynor@redhat.com>

On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> Coverity complains that ctrl_flags is set to NULL at the start
> of the function and it may not have been set before there is a
> jump to fc_success and it is dereferenced.
>
> Check for NULL before dereference.
>
> 312fc_success:
>    CID 344983 (#1 of 1): Explicit null dereferenced
>    (FORWARD_NULL)7. var_deref_op: Dereferencing null pointer ctrl_flags.
> 313        *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);
>
> Coverity issue: 344983
> Fixes: 6cc54096520d ("crypto/octeontx: add supported sessions")
> Cc: ndabilpuram@marvell.com
> Cc: stable@dpdk.org

Cc: maintainer

>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>
> ---
>
> There may be further rework needed to set it to the correct value,
> but for now at least prevent the NULL dereference.
> ---
>  drivers/common/cpt/cpt_ucode.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h
> index 7d9c31e17..fad978c6e 100644
> --- a/drivers/common/cpt/cpt_ucode.h
> +++ b/drivers/common/cpt/cpt_ucode.h
> @@ -311,5 +311,6 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,
>
>  fc_success:
> -       *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);
> +       if (ctrl_flags != NULL)
> +               *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);
>
>  success:
> --
> 2.21.0
>

Reviewed-by: David Marchand <david.marchand@redhat.com>

-- 
David Marchand

  parent reply	other threads:[~2019-10-30  7:56 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191001125315.6191-1-ktraynor@redhat.com>
2019-10-01 12:53 ` [dpdk-stable] [PATCH 1/9] net/pcap: fix argument checks Kevin Traynor
2019-10-04 10:57   ` Ferriter, Cian
2019-10-30  7:52   ` [dpdk-stable] [dpdk-dev] " David Marchand
2019-11-05 16:40     ` Kevin Traynor
2019-11-05 17:10       ` Ferriter, Cian
2019-11-06 19:03         ` Kevin Traynor
2019-10-01 13:03 ` [dpdk-stable] [PATCH 2/9] crypto/octeontx: fix possible NULL deference Kevin Traynor
2019-10-01 13:03   ` [dpdk-stable] [PATCH 3/9] net/bnxt: remove logically dead code Kevin Traynor
2019-10-02  1:28     ` [dpdk-stable] [dpdk-dev] " Ajit Khaparde
2019-10-30  7:43       ` David Marchand
2019-10-30 16:27         ` Ajit Khaparde
2019-11-05 15:39           ` Kevin Traynor
2019-10-01 13:04   ` [dpdk-stable] [PATCH 4/9] net/ipn3ke: fix incorrect commit check logic Kevin Traynor
2019-10-30  7:59     ` [dpdk-stable] [dpdk-dev] " David Marchand
2019-11-05 15:41       ` Kevin Traynor
2019-11-08 14:45         ` Xu, Rosen
2019-11-08 14:47           ` Kevin Traynor
2019-11-08 14:35       ` Xu, Rosen
2019-11-08 14:52     ` [dpdk-stable] " Xu, Rosen
2019-10-01 13:04   ` [dpdk-stable] [PATCH 5/9] net/ipn3ke: remove useless if statement Kevin Traynor
2019-10-30  8:01     ` David Marchand
2019-11-08 14:35       ` Xu, Rosen
2019-11-08 14:52     ` Xu, Rosen
2019-10-01 13:04   ` [dpdk-stable] [PATCH 6/9] net/ipn3ke: remove commented out code Kevin Traynor
2019-10-30  8:04     ` David Marchand
2019-11-08 14:40       ` Xu, Rosen
2019-11-08 14:51     ` Xu, Rosen
2019-10-01 13:04   ` [dpdk-stable] [PATCH 7/9] compress/octeontx: " Kevin Traynor
2019-10-30  8:06     ` [dpdk-stable] [dpdk-dev] " David Marchand
2019-10-01 13:04   ` [dpdk-stable] [PATCH 8/9] event/opdl: " Kevin Traynor
2019-10-03 10:50     ` Liang, Ma
2019-10-01 13:04   ` [dpdk-stable] [PATCH 9/9] net/bnxt: " Kevin Traynor
2019-10-01 15:42     ` Ajit Khaparde
2019-10-30  7:56   ` David Marchand [this message]
     [not found] ` <20191106190203.10750-1-ktraynor@redhat.com>
2019-11-06 19:01   ` [dpdk-stable] [v2 PATCH 1/8] net/pcap: fix argument checks Kevin Traynor
2019-11-06 19:01   ` [dpdk-stable] [v2 PATCH 2/8] common/cpt: fix possible NULL deference Kevin Traynor
2019-11-06 19:01   ` [dpdk-stable] [v2 PATCH 3/8] net/ipn3ke: fix incorrect commit check logic Kevin Traynor
2019-11-08 14:50     ` Xu, Rosen
2019-11-06 19:01   ` [dpdk-stable] [v2 PATCH 4/8] net/ipn3ke: remove useless if statement Kevin Traynor
2019-11-08 14:49     ` Xu, Rosen
2019-11-06 19:02   ` [dpdk-stable] [v2 PATCH 5/8] net/ipn3ke: remove commented out code Kevin Traynor
2019-11-08 14:50     ` Xu, Rosen
2019-11-06 19:02   ` [dpdk-stable] [v2 PATCH 6/8] compress/octeontx: " Kevin Traynor
2019-11-06 19:02   ` [dpdk-stable] [v2 PATCH 7/8] event/opdl: " Kevin Traynor
2019-11-06 19:02   ` [dpdk-stable] [v2 PATCH 8/8] net/bnxt: " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJFAV8zb837kAAY9iS=Z2r1vt8uvFrk3CVrV0VoYCUQ+SWij_Q@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ktraynor@redhat.com \
    --cc=ndabilpuram@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).