From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BE1C4A0A02; Tue, 18 May 2021 10:55:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 821F04068E; Tue, 18 May 2021 10:55:48 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 6E8F540041; Tue, 18 May 2021 10:55:47 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 054085C01BC; Tue, 18 May 2021 04:55:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 18 May 2021 04:55:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= eGPcVqyokQMsOEJLKTV9340205yuJdtnYlWjuhc1JHM=; b=pA+xBfPS/IFVY/X3 Cyeab8Z100urDWNAHomh1zQGAjwye75W6eB7JiKpeAnHbVtZIe3qmrW0M1W7nv4K K0q0iO5FKZ89G5L+ZSDYuruBPO4QmyzVAfSJPrG+fLJUJ2t5CToY4dnxgWnIlZr2 8d5ko9SqvJuCVe4nDqpMBxYCLgtjpFjXtHXCKPUf3DhoshpTW1ig6wA9VS4o5DHu jqO23+zQWlleoAP+v+kJid5DTp1UyFktay2uubelnX3Ou3BeNrXF34YtI3awQkde RTPmlUXll4X5p2tRJ8jnT1xsUxYfEMFEISwXayQFsTu1VotNeXmZONYhElf4wA3e WogfcA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=eGPcVqyokQMsOEJLKTV9340205yuJdtnYlWjuhc1J HM=; b=kEMRmqgO0frHCbpcJfpUP8VSLUtt1i2w7QNhWzc/TiwOyE0HHZxVdJI5C /BhWtv9qoB17GSDhamE5Xjwxq8pLAPxBhZfFrkDVvg+8GZ69NSBu/QhHZKEt6vRc vSRMOQn5I1L3mkcYOIBwJcUdORgzvatna9BgRX2loincQgTkberCvA2QNc1ZNXEB LIUnBr+DGmCGAosUovZLKfHumcf/FnZJVB3xiajCTO1VL7BDYvdqKclLm+4faXOz 74z+aTG/XCui1gdd75AWZpHcjYvchMdhXvNRUR9vx+0FFwVlICsRB6X6o8TQyaeM y1WNfYW1hUkJ9pSqK2IogEzbhS47g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeijedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtqhertddttdejnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepkeethedtieevhfeigeejleegudefjeehkeekteeuveeiuedvveeu tdejveehveetnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 May 2021 04:55:45 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: Cristian Dumitrescu , Pablo de Lara Guarch , dev@dpdk.org, stable@dpdk.org, Kevin Traynor Date: Tue, 18 May 2021 10:55:44 +0200 Message-ID: <16891120.zO6uBrY9Ry@thomas> In-Reply-To: <20210517155739.800371-1-ferruh.yigit@intel.com> References: <20210517155739.800371-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] test/table: fix build with GCC 11 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 17/05/2021 17:57, Ferruh Yigit: > Build error: > ../app/test/test_table_tables.c: In function =E2=80=98test_table_stub=E2= =80=99: > ../app/test/test_table_tables.c:31:9: > warning: =E2=80=98memset=E2=80=99 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 =E2=80=98PREPARE_PACKET=E2=80=99 > 151 | PREPARE_PACKET(mbufs[i], 0xadadadad); > | ^~~~~~~~~~~~~~ >=20 > '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. >=20 > The original code has an assumption that mbuf data buffer follows mbuf > header, this patch accepts same assumption. >=20 > Bugzilla ID: 677 > Fixes: 5205954791cb ("app/test: packet framework unit tests") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ferruh Yigit > --- > Cc: cristian.dumitrescu@intel.com > Cc: Kevin Traynor >=20 > 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