patch 'ethdev: fix 32-bit build with GCC 13' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Mon Dec 11 11:10:58 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/13/23. 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.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=73440e9fd34389f4ed218b95ac0b1d594cd84095

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 73440e9fd34389f4ed218b95ac0b1d594cd84095 Mon Sep 17 00:00:00 2001
From: Ruifeng Wang <ruifeng.wang at arm.com>
Date: Wed, 1 Nov 2023 15:15:54 +0800
Subject: [PATCH] ethdev: fix 32-bit build with GCC 13
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 3d67012ab70252190fcfea12c122567a4d010228 ]

aarch32 build with gcc-13.0.1 generated following warning:

In function 'memcpy',
 inlined from 'rte_memcpy' at .../eal/arm/include/rte_memcpy_32.h:296:9,
 inlined from 'rte_flow_conv_action_conf' at .../rte_flow.c:726:20,
 inlined from 'rte_flow_conv_actions' at .../ethdev/rte_flow.c:936:10:
warning: '__builtin_memcpy' specified bound 4294967264 exceeds maximum
         object size 2147483647 [-Wstringop-overflow=]

The issue is due to possible wrapping in unsigned arithmetic.
The 'size' can be 0. 'off' is 32. When 'tmp' is equal to (unsigned)-32,
the copy length is more than half the address space. Hence the warning.

Cast variables to 64-bit to avoid wrapping.

Fixes: 063911ee1df4 ("ethdev: add flow API object converter")

Reported-by: Luca Boccassi <bluca at debian.org>
Signed-off-by: Ruifeng Wang <ruifeng.wang at arm.com>
Acked-by: Ori Kam <orika at nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit at amd.com>
---
 lib/ethdev/rte_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 2eadb0a032..ae22755ee6 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -654,7 +654,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
 		if (src.rss->key_len && src.rss->key) {
 			off = RTE_ALIGN_CEIL(off, sizeof(*dst.rss->key));
 			tmp = sizeof(*src.rss->key) * src.rss->key_len;
-			if (size >= off + tmp)
+			if (size >= (uint64_t)off + (uint64_t)tmp)
 				dst.rss->key = rte_memcpy
 					((void *)((uintptr_t)dst.rss + off),
 					 src.rss->key, tmp);
@@ -663,7 +663,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
 		if (src.rss->queue_num) {
 			off = RTE_ALIGN_CEIL(off, sizeof(*dst.rss->queue));
 			tmp = sizeof(*src.rss->queue) * src.rss->queue_num;
-			if (size >= off + tmp)
+			if (size >= (uint64_t)off + (uint64_t)tmp)
 				dst.rss->queue = rte_memcpy
 					((void *)((uintptr_t)dst.rss + off),
 					 src.rss->queue, tmp);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-12-11 17:56:24.248016300 +0800
+++ 0033-ethdev-fix-32-bit-build-with-GCC-13.patch	2023-12-11 17:56:22.947652300 +0800
@@ -1 +1 @@
-From 3d67012ab70252190fcfea12c122567a4d010228 Mon Sep 17 00:00:00 2001
+From 73440e9fd34389f4ed218b95ac0b1d594cd84095 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 3d67012ab70252190fcfea12c122567a4d010228 ]
@@ -22 +24,0 @@
-Cc: stable at dpdk.org
@@ -33 +35 @@
-index 4d6c28ee0e..20ee8430ea 100644
+index 2eadb0a032..ae22755ee6 100644
@@ -36 +38 @@
-@@ -724,7 +724,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
+@@ -654,7 +654,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
@@ -45 +47 @@
-@@ -733,7 +733,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size,
+@@ -663,7 +663,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size,


More information about the stable mailing list