1 Star 0 Fork 75

sky/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0106-net-tap-fix-device-freeing.patch 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
liudongdong3 提交于 2022-06-16 16:03 . sync patches from 22.07
From 601f63e2f591a0b191c0ab0d4b39e826b15a0226 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Tue, 7 Jun 2022 14:50:57 +0800
Subject: [PATCH 106/122] net/tap: fix device freeing
The error path was calling rte_eth_dev_release_port() function,
which frees eth_dev->data->dev_private, and then tries to free
pmd->intr_handle, which causes the use after free issue.
The free can be moved to before the release function is called.
Fixes: d61138d4f0e ("drivers: remove direct access to interrupt handle")
Cc: stable@dpdk.org
Signed-off-by: Xiangjun Meng <mengxiangjun4@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
drivers/net/tap/rte_eth_tap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index f1b48cae82..ddca630574 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2099,8 +2099,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
close(pmd->ioctl_sock);
/* mac_addrs must not be freed alone because part of dev_private */
dev->data->mac_addrs = NULL;
- rte_eth_dev_release_port(dev);
rte_intr_instance_free(pmd->intr_handle);
+ rte_eth_dev_release_port(dev);
error_exit_nodev:
TAP_LOG(ERR, "%s Unable to initialize %s",
--
2.22.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/dpdk.git
git@gitee.com:nlgwcy/dpdk.git
nlgwcy
dpdk
dpdk
master

搜索帮助