net/ena: fix crash with unsupported device argument
authorMichal Krawczyk <mk@semihalf.com>
Tue, 11 May 2021 06:45:47 +0000 (08:45 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 11 May 2021 13:00:44 +0000 (15:00 +0200)
As the documentation of rte_kvargs_parse() states, the valid_keys
argument must be NULL terminated. Lack of this feature may cause
segmentation fault if the passed devarg will be different then the
supported value.

Fixes: 8a7a73f26cc9 ("net/ena: support large LLQ headers")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/ena/ena_ethdev.c

index 53647cc..9721a70 100644 (file)
@@ -2876,6 +2876,7 @@ static int ena_parse_devargs(struct ena_adapter *adapter,
 {
        static const char * const allowed_args[] = {
                ENA_DEVARG_LARGE_LLQ_HDR,
+               NULL,
        };
        struct rte_kvargs *kvlist;
        int rc;