* [PATCH] crypto/openssl: fix potential string overflow
@ 2024-10-17 16:07 Stephen Hemminger
2024-11-06 11:32 ` [EXTERNAL] " Akhil Goyal
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2024-10-17 16:07 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, asekhar, Kai Ji
The algorithm name is a string and should be copied with strlcpy()
rather than rte_memcpy(). This fixes a warning detected with
clang and ASAN.
Bugzilla ID: 1565
Fixes: 2b9c693f6ef5 ("crypto/openssl: support AES-CMAC operations")
Cc: asekhar@marvell.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
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 9657b70c7a..bb706dd3e8 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -692,7 +692,7 @@ openssl_set_session_auth_parameters(struct openssl_session *sess,
else
return -EINVAL;
- rte_memcpy(algo_name, algo, strlen(algo) + 1);
+ strlcpy(algo_name, algo, sizeof(algo_name));
params[0] = OSSL_PARAM_construct_utf8_string(
OSSL_MAC_PARAM_CIPHER, algo_name, 0);
params[1] = OSSL_PARAM_construct_end();
--
2.45.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [EXTERNAL] [PATCH] crypto/openssl: fix potential string overflow
2024-10-17 16:07 [PATCH] crypto/openssl: fix potential string overflow Stephen Hemminger
@ 2024-11-06 11:32 ` Akhil Goyal
0 siblings, 0 replies; 2+ messages in thread
From: Akhil Goyal @ 2024-11-06 11:32 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: Ashwin Sekhar T K, Kai Ji, stable
> The algorithm name is a string and should be copied with strlcpy()
> rather than rte_memcpy(). This fixes a warning detected with
> clang and ASAN.
>
> Bugzilla ID: 1565
> Fixes: 2b9c693f6ef5 ("crypto/openssl: support AES-CMAC operations")
> Cc: asekhar@marvell.com
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Cc: stable@dpdk.org
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-06 11:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-17 16:07 [PATCH] crypto/openssl: fix potential string overflow Stephen Hemminger
2024-11-06 11:32 ` [EXTERNAL] " Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).