diff mbox series

[1/2] net/i40e: fix veb index negative was not checked

Message ID 1618972394-14045-2-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted
Delegated to: Qi Zhang
Headers show
Series fixes for i40e PMD | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Min Hu (Connor) April 21, 2021, 2:33 a.m. UTC
From: Chengwen Feng <fengchengwen@huawei.com>

This patch adds checking for veb index negative when parsing veb list.

Fixes: 79f2248219c0 (net/i40e: add floating VEB option)
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/i40e/i40e_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Zhang, Qi Z April 22, 2021, 1:17 p.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Min Hu (Connor)
> Sent: Wednesday, April 21, 2021 10:33 AM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Guo, Jia <jia.guo@intel.com>
> Subject: [dpdk-dev] [PATCH 1/2] net/i40e: fix veb index negative was not
> checked
> 
> From: Chengwen Feng <fengchengwen@huawei.com>
> 
> This patch adds checking for veb index negative when parsing veb list.
> 
> Fixes: 79f2248219c0 (net/i40e: add floating VEB option)
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
diff mbox series

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index e6206a7..c897c81 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 == '-') {