cryptodev: fix parameter parsing
authorHaggai Eran <haggaie@nvidia.com>
Thu, 8 Oct 2020 19:42:14 +0000 (22:42 +0300)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 14 Oct 2020 20:22:06 +0000 (22:22 +0200)
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")
Cc: stable@dpdk.org
Signed-off-by: Haggai Eran <haggaie@nvidia.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
lib/librte_cryptodev/rte_cryptodev_pmd.h

index 81975d7..1367222 100644 (file)
@@ -41,7 +41,8 @@ extern "C" {
 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
 };
 
 /**