From 47b6667abe533e8c61576aa4803f41daf988eb9b Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Wed, 21 Apr 2021 10:33:13 +0800 Subject: [PATCH] net/i40e: fix negative VEB index This patch adds check for negative VEB index when parsing VEB list. Fixes: 79f2248219c0 ("net/i40e: add floating VEB option") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) Acked-by: Qi Zhang --- drivers/net/i40e/i40e_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 66d23d698e..d0586201f8 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -854,6 +854,8 @@ floating_veb_list_handler(__rte_unused const char *key, idx = strtoul(floating_veb_value, &end, 10); if (errno || end == NULL) return -1; + if (idx < 0) + return -1; while (isblank(*end)) end++; if (*end == '-') { -- 2.20.1