[dpdk-stable] patch 'eal/x86: ignore gcc 10 stringop-overflow warnings' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:04:28 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From df17bcb43b419b5157a8e202d6277aa4a0029bae Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor at redhat.com>
Date: Fri, 17 Apr 2020 16:43:35 +0100
Subject: [PATCH] eal/x86: ignore gcc 10 stringop-overflow warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit b5b3ea803e4741ad6a46a38d8227c78226d9054d ]

stringop-overflow warns when it sees a possible overflow
in a string operation.

In the rte_memcpy functions different branches are taken
depending on the size. stringop-overflow is raised for the
branches in the function where it sees the static size of the
src could be overflowed.

However, in reality a correct size argument and in some cases
dynamic allocation would ensure that this does not happen.

For example, in the case below for key, the correct path will be
chosen in rte_memcpy_generic at runtime based on the size argument
but as some paths in the function could lead to a cast to 32 bytes
a warning is raised.

In function ‘_mm256_storeu_si256’,
inlined from ‘rte_memcpy_generic’
at ../lib/librte_eal/common/include/arch/x86/rte_memcpy.h:315:2,
inlined from ‘iavf_configure_rss_key’
at ../lib/librte_eal/common/include/arch/x86/rte_memcpy.h:869:10:

/usr/lib/gcc/x86_64-redhat-linux/10/include/avxintrin.h:928:8:
warning: writing 32 bytes into a region of size 1 [-Wstringop-overflow=]
  928 |   *__P = __A;
      |   ~~~~~^~~~~
In file included
from ../drivers/net/iavf/../../common/iavf/iavf_prototype.h:10,
from ../drivers/net/iavf/iavf.h:9,
from ../drivers/net/iavf/iavf_vchnl.c:22:

../drivers/net/iavf/iavf_vchnl.c:
In function ‘iavf_configure_rss_key’:

../drivers/net/iavf/../../common/iavf/virtchnl.h:508:5:
note: at offset 0 to object ‘key’ with size 1 declared here
  508 |  u8 key[1];         /* RSS hash key, packed bytes */
      |     ^~~

Ignore the stringop-overflow warnings for rte_memcpy.h functions.

Bugzilla ID: 394
Bugzilla ID: 421

Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
---
 lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
index ba44c4a328..9c67232df9 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
@@ -22,6 +22,11 @@
 extern "C" {
 #endif
 
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100000)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
+
 /**
  * Copy bytes from one location to another. The locations must not overlap.
  *
@@ -869,6 +874,10 @@ rte_memcpy(void *dst, const void *src, size_t n)
 		return rte_memcpy_generic(dst, src, n);
 }
 
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100000)
+#pragma GCC diagnostic pop
+#endif
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:49.865529125 +0100
+++ 0133-eal-x86-ignore-gcc-10-stringop-overflow-warnings.patch	2020-05-19 14:04:44.444652506 +0100
@@ -1,4 +1,4 @@
-From b5b3ea803e4741ad6a46a38d8227c78226d9054d Mon Sep 17 00:00:00 2001
+From df17bcb43b419b5157a8e202d6277aa4a0029bae Mon Sep 17 00:00:00 2001
 From: Kevin Traynor <ktraynor at redhat.com>
 Date: Fri, 17 Apr 2020 16:43:35 +0100
 Subject: [PATCH] eal/x86: ignore gcc 10 stringop-overflow warnings
@@ -6,6 +6,8 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit b5b3ea803e4741ad6a46a38d8227c78226d9054d ]
+
 stringop-overflow warns when it sees a possible overflow
 in a string operation.
 
@@ -49,19 +51,18 @@
 
 Bugzilla ID: 394
 Bugzilla ID: 421
-Cc: stable at dpdk.org
 
 Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
 Acked-by: Bruce Richardson <bruce.richardson at intel.com>
 Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
 ---
- lib/librte_eal/x86/include/rte_memcpy.h | 9 +++++++++
+ lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 9 +++++++++
  1 file changed, 9 insertions(+)
 
-diff --git a/lib/librte_eal/x86/include/rte_memcpy.h b/lib/librte_eal/x86/include/rte_memcpy.h
+diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
 index ba44c4a328..9c67232df9 100644
---- a/lib/librte_eal/x86/include/rte_memcpy.h
-+++ b/lib/librte_eal/x86/include/rte_memcpy.h
+--- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
++++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
 @@ -22,6 +22,11 @@
  extern "C" {
  #endif


More information about the stable mailing list