加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0105-net-failsafe-fix-device-freeing.patch 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
liudongdong3 提交于 2022-06-16 16:03 . sync patches from 22.07
From f74659ac42dca5d47b03de3b22010a0f45434137 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Tue, 7 Jun 2022 14:50:49 +0800
Subject: [PATCH 105/122] net/failsafe: fix device freeing
The PMD destroy function was calling the release function, which frees
dev->data->dev_private, and then tries to free PRIV(dev)->intr_handle,
which causes the heap 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: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
drivers/net/failsafe/failsafe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 3c754a5f66..05cf533896 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -308,8 +308,8 @@ fs_rte_eth_free(const char *name)
if (dev == NULL)
return 0; /* port already released */
ret = failsafe_eth_dev_close(dev);
- rte_eth_dev_release_port(dev);
rte_intr_instance_free(PRIV(dev)->intr_handle);
+ rte_eth_dev_release_port(dev);
return ret;
}
--
2.22.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化