DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Ciara Power <ciara.power@intel.com>
Cc: dev <dev@dpdk.org>,
	"Kovacevic, Marko" <marko.kovacevic@intel.com>,
	 Fan Zhang <roy.fan.zhang@intel.com>,
	dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] examples/fips_validation: fix checking return value
Date: Fri, 30 Oct 2020 14:01:15 +0100	[thread overview]
Message-ID: <CAJFAV8wL-LraiRsgXMZtVjkJC=P5WYaR2nSw4SvB15uQ_wgRgw@mail.gmail.com> (raw)
In-Reply-To: <20201028153808.103328-1-ciara.power@intel.com>

On Wed, Oct 28, 2020 at 4:38 PM Ciara Power <ciara.power@intel.com> wrote:
>
> The return value was not being checked when calling the
> get_writeback_data function in the AES test case. On failure, this led
> to a NULL dereference when using memcpy later. The return value is now
> checked to avoid this NULL dereference.
>
> Coverity issue: 363463
> Fixes: cd255ccf5764 ("examples/fips_validation: support AES parsing")

I'd rather flag:
Fixes: 952e10cdad5e ("examples/fips_validation: support scatter gather list")

Can you double check?


> Cc: marko.kovacevic@intel.com
> Cc: roy.fan.zhang@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>  examples/fips_validation/main.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
> index 07532c9562..bc7abd2b8f 100644
> --- a/examples/fips_validation/main.c
> +++ b/examples/fips_validation/main.c
> @@ -1520,7 +1520,9 @@ fips_mct_aes_test(void)
>                                 return ret;
>                         }
>
> -                       get_writeback_data(&val);
> +                       ret = get_writeback_data(&val);
> +                       if (ret < 0)
> +                               return ret;
>
>                         if (info.op == FIPS_TEST_DEC_AUTH_VERIF)
>                                 memcpy(prev_in, vec.ct.val, AES_BLOCK_SIZE);

And I think we have the same issue in fips_mct_sha_test().


-- 
David Marchand


  reply	other threads:[~2020-10-30 13:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 15:38 Ciara Power
2020-10-30 13:01 ` David Marchand [this message]
2020-10-30 15:37 ` [dpdk-dev] [PATCH v2] " Ciara Power
2020-10-31 17:09   ` David Marchand

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='CAJFAV8wL-LraiRsgXMZtVjkJC=P5WYaR2nSw4SvB15uQ_wgRgw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=marko.kovacevic@intel.com \
    --cc=roy.fan.zhang@intel.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).