crypto/openssl: fix potential string overflow
PATCH 1/1 crypto/openssl: fix potential string overflow
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")
Signed-off-by Stephen Hemminger <[email protected]>
--- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/openssl/rte_openssl_pmd.c +1 -1
@@ -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 ();
Signature · 1 line
2.45.2
Quoted 10 lines
The algorithm name is a string and should be copied with
strlcpy()rather thanrte_memcpy(). This fixes a warning detected with clang and ASAN.Bugzilla ID: 1565
Fixes 2b9c693f6ef5 ("crypto/openssl: support AES-CMAC operations")Signed-off-by Stephen Hemminger <[email protected]>
Cc: [email protected]
Applied to dpdk-next-crypto
Thanks.