patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
	Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>,
	dev@dpdk.org, stable@dpdk.org,
	Kevin Traynor <ktraynor@redhat.com>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] test/table: fix build with GCC 11
Date: Tue, 18 May 2021 10:55:44 +0200
Message-ID: <16891120.zO6uBrY9Ry@thomas> (raw)
In-Reply-To: <20210517155739.800371-1-ferruh.yigit@intel.com>

17/05/2021 17:57, Ferruh Yigit:
> Build error:
> ../app/test/test_table_tables.c: In function ‘test_table_stub’:
> ../app/test/test_table_tables.c:31:9:
> 	warning: ‘memset’ offset [0, 31] is out of the bounds [0, 0]
> 	[-Warray-bounds]
>          memset((uint8_t *)mbuf + sizeof(struct rte_mbuf) + 32, 0, 32); \
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../app/test/test_table_tables.c:151:25:
> 	note: in expansion of macro ‘PREPARE_PACKET’
>   151 |                         PREPARE_PACKET(mbufs[i], 0xadadadad);
>       |                         ^~~~~~~~~~~~~~
> 
> 'key' points to mbuf header + 32 bytes, and memset clears next 32 bytes
> of 'key', so overall there needs to be 64 bytes after mbuf header.
> Adding a mbuf size check before memset.
> 
> The original code has an assumption that mbuf data buffer follows mbuf
> header, this patch accepts same assumption.
> 
> Bugzilla ID: 677
> Fixes: 5205954791cb ("app/test: packet framework unit tests")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: cristian.dumitrescu@intel.com
> Cc: Kevin Traynor <ktraynor@redhat.com>
> 
> Not exactly clear why compiler complains about, compiler can't know the
> bounds of the memory we try to memset here.
> But adding a size check seems logic thing to do also fixes the compiler
> warning.

Applied, thanks




  reply	other threads:[~2021-05-18  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 15:57 [dpdk-stable] " Ferruh Yigit
2021-05-18  8:55 ` Thomas Monjalon [this message]
2021-05-18  9:29   ` [dpdk-stable] [dpdk-dev] " 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=16891120.zO6uBrY9Ry@thomas \
    --to=thomas@monjalon.net \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=ktraynor@redhat.com \
    --cc=pablo.de.lara.guarch@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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git