提交 0b9b0679 编写于 作者: D Dan Carpenter 提交者: Zheng Zengkai

Drivers: hv: vmbus: Use after free in __vmbus_open()

stable inclusion
from stable-5.10.37
commit d5c7b42c9f56ca46b286daa537d181bd7f69214f
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit 3e9bf43f ]

The "open_info" variable is added to the &vmbus_connection.chn_msg_list,
but the error handling frees "open_info" without removing it from the
list.  This will result in a use after free.  First remove it from the
list, and then free it.

Fixes: 6f3d791f ("Drivers: hv: vmbus: Fix rescind handling issues")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NAndrea Parri <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/YHV3XLCot6xBS44r@mwandaSigned-off-by: NWei Liu <wei.liu@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 78113e5a
...@@ -583,7 +583,7 @@ static int __vmbus_open(struct vmbus_channel *newchannel, ...@@ -583,7 +583,7 @@ static int __vmbus_open(struct vmbus_channel *newchannel,
if (newchannel->rescind) { if (newchannel->rescind) {
err = -ENODEV; err = -ENODEV;
goto error_free_info; goto error_clean_msglist;
} }
err = vmbus_post_msg(open_msg, err = vmbus_post_msg(open_msg,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册