patch 'crypto/openssl: fix warning on copy length' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Mon Feb 27 07:59:21 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.2

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 24dc362291a26d0450a72193a4e06839bb743bdc Mon Sep 17 00:00:00 2001
From: Ruifeng Wang <ruifeng.wang at arm.com>
Date: Mon, 9 Jan 2023 11:40:21 +0800
Subject: [PATCH] crypto/openssl: fix warning on copy length
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit f481e9272a2f7c980519eac773acf0a9af23ea34 ]

When building with gcc 11.2.0, the compiler warns as follows:
In function 'memcpy',
    inlined from 'openssl_set_session_auth_parameters' at
      ../drivers/crypto/openssl/rte_openssl_pmd.c:699:3,
    inlined from 'openssl_set_session_parameters' at
      ../drivers/crypto/openssl/rte_openssl_pmd.c:826:9:
/usr/include/aarch64-linux-gnu/bits/string_fortified.h:29:10: warning:
'__builtin_memcpy' forming offset [4, 8] is out of the bounds [0, 4]

Fixed the warning by copying up to string / buffer size.

Fixes: 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP API")

Signed-off-by: Ruifeng Wang <ruifeng.wang at arm.com>
Reviewed-by: Feifei Wang <feifei.wang2 at arm.com>
---
 drivers/crypto/openssl/rte_openssl_pmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 05449b6e98..abcb641a44 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -696,7 +696,7 @@ openssl_set_session_auth_parameters(struct openssl_session *sess,
 		algo = digest_name_get(xform->auth.algo);
 		if (!algo)
 			return -EINVAL;
-		rte_memcpy(algo_name, algo, (sizeof(algo)+1));
+		strlcpy(algo_name, algo, sizeof(algo_name));

 		mac = EVP_MAC_fetch(NULL, "HMAC", NULL);
 		sess->auth.hmac.ctx = EVP_MAC_CTX_new(mac);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.647901900 +0800
+++ 0054-crypto-openssl-fix-warning-on-copy-length.patch	2023-02-27 14:08:40.779237000 +0800
@@ -1 +1 @@
-From f481e9272a2f7c980519eac773acf0a9af23ea34 Mon Sep 17 00:00:00 2001
+From 24dc362291a26d0450a72193a4e06839bb743bdc Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit f481e9272a2f7c980519eac773acf0a9af23ea34 ]
@@ -18 +20,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list