Skip to contentSkip to conversation

cryptodev: fix cryptodev parameter parsing

PATCH Applied Haggai Eran 2 participants 2 messages Oct 8, 2020 – Oct 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cryptodev: fix cryptodev parameter parsing

The rte_cryptodev_pmd_parse_input_args function crashes with a segmentation fault when passing a non-empty argument string.

The function passes cryptodev_pmd_valid_params to rte_kvargs_parse, which accepts a NULL-terminated list of valid keys, yet cryptodev_pmd_valid_params does not end with NULL. The patch adds the missing NULL pointer.

Fixes 9e6edea41805 ("cryptodev: add APIs to assist PMD initialisation")
---
 lib/librte_cryptodev/rte_cryptodev_pmd.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_cryptodev/rte_cryptodev_pmd.h +2 -1
index 81975d72b47a..1367222f7350 100644
@@ -41,7 +41,8 @@
 static const char * const cryptodev_pmd_valid_params[] = {
 	RTE_CRYPTODEV_PMD_NAME_ARG,
 	RTE_CRYPTODEV_PMD_MAX_NB_QP_ARG,
-	RTE_CRYPTODEV_PMD_SOCKET_ID_ARG
+	RTE_CRYPTODEV_PMD_SOCKET_ID_ARG,
+	NULL
 };
 
 /**
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 8 lines

The rte_cryptodev_pmd_parse_input_args function crashes with a segmentation fault when passing a non-empty argument string.

The function passes cryptodev_pmd_valid_params to rte_kvargs_parse, which accepts a NULL-terminated list of valid keys, yet cryptodev_pmd_valid_params does not end with NULL. The patch adds the missing NULL pointer.

Quoted 5 lines
Fixes 9e6edea41805 ("cryptodev: add APIs to assist PMD initialisation")

---

Applied to dpdk-next-crypto

Thanks.