代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 51a50c25f5884df574cb254ee92de23bc821c0b4 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:10 +0000
Subject: net/virtio: fix empty devargs parsing
[ upstream commit 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 ]
The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.
This patch fixes segment fault when parse input args with 'only keys'
(e.g. vectorized,vdpa).
Fixes: 4710e16a4a7b ("net/virtio: add parameter to enable vectorized path")
Fixes: 44d7b2e87b69 ("net/virtio: refactor devargs parsing")
Fixes: 440f03c25378 ("net/virtio: skip device probe in vDPA mode")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/net/virtio/virtio_ethdev.c | 3 +++
drivers/net/virtio/virtio_pci_ethdev.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index a38b15d01c..c22b2f2889 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2474,6 +2474,9 @@ virtio_dev_speed_capa_get(uint32_t speed)
static int vectorized_check_handler(__rte_unused const char *key,
const char *value, void *ret_val)
{
+ if (value == NULL || ret_val == NULL)
+ return -EINVAL;
+
if (strcmp(value, "1") == 0)
*(int *)ret_val = 1;
else
diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c
index 54645dc62e..de7b1ef344 100644
--- a/drivers/net/virtio/virtio_pci_ethdev.c
+++ b/drivers/net/virtio/virtio_pci_ethdev.c
@@ -138,6 +138,9 @@ eth_virtio_pci_uninit(struct rte_eth_dev *eth_dev)
static int vdpa_check_handler(__rte_unused const char *key,
const char *value, void *ret_val)
{
+ if (value == NULL || ret_val == NULL)
+ return -EINVAL;
+
if (strcmp(value, "1") == 0)
*(int *)ret_val = 1;
else
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。