DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <gakhil@marvell.com>
To: Kevin Traynor <ktraynor@redhat.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>,
	Declan Doherty <declan.doherty@intel.com>,
	Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>,
	John Griffin <john.griffin@intel.com>,
	Des O Dea <des.j.o.dea@intel.com>,
	Fiona Trahe <fiona.trahe@intel.com>
Subject: Re: [dpdk-dev] [EXT] [PATCH] test/crypto: fix gcc 11 array-bounds error
Date: Mon, 17 May 2021 19:24:24 +0000	[thread overview]
Message-ID: <MW2PR18MB22845D58070C75652467E978D82D9@MW2PR18MB2284.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20210505085314.54750-1-ktraynor@redhat.com>

> $ gcc --version
> gcc (GCC) 11.1.1 20210428 (Red Hat 11.1.1-1)
> 
> /test_cryptodev.c.o -c ../app/test/test_cryptodev.c
> ../app/test/test_cryptodev.c: In function ‘test_multi_session’:
> ../app/test/test_cryptodev.c:10447:9:
> error: array subscript ‘struct rte_cryptodev_sym_session *[4]’
> is partly outside array bounds of ‘unsigned char[33]’
> [-Werror=array-bounds]
> 10447 |   rte_cryptodev_sym_session_init(ts_params->valid_devs[0],
>       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 10448 |     sessions[i], &ut_params->auth_xform,
>       |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 10449 |     ts_params->session_priv_mpool);
>       |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../app/test/test_cryptodev.c:10399:20:
> note: referencing an object of size 33 allocated by ‘rte_malloc’
> 10399 |  sessions = rte_malloc(NULL,
>       |             ^~~~~~~~~~~~~~~~
> 10400 |             (sizeof(struct rte_cryptodev_sym_session *) *
>       |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 10401 |             MAX_NB_SESSIONS) + 1, 0);
>       |             ~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Fix the allocation for sessions, to prevent an array-bounds
> warning with gcc 11. Set the not created session to NULL.
> 
> Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto

      reply	other threads:[~2021-05-17 19:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05  8:53 [dpdk-dev] " Kevin Traynor
2021-05-17 19:24 ` Akhil Goyal [this message]

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=MW2PR18MB22845D58070C75652467E978D82D9@MW2PR18MB2284.namprd18.prod.outlook.com \
    --to=gakhil@marvell.com \
    --cc=declan.doherty@intel.com \
    --cc=des.j.o.dea@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=john.griffin@intel.com \
    --cc=ktraynor@redhat.com \
    --cc=sergio.gonzalez.monroy@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).