[PATCH openEuler-1.0-LTS] Drivers: hv: vmbus: Use after free in __vmbus_open()

From: Dan Carpenter <dan.carpenter@oracle.com> mainline inclusion from mainline-v5.13-rc1 commit 3e9bf43f7f7a46f21ec071cb47be92d0874c48da category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I94JKH CVE: CVE-2021-47049 --------------------------- 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: 6f3d791f3006 ("Drivers: hv: vmbus: Fix rescind handling issues") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Andrea Parri <parri.andrea@gmail.com> Link: https://lore.kernel.org/r/YHV3XLCot6xBS44r@mwanda Signed-off-by: Wei Liu <wei.liu@kernel.org> Conflicts: drivers/hv/channel.c Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> --- drivers/hv/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 5e515533e9cd..756d2fff50dc 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -194,7 +194,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, if (newchannel->rescind) { err = -ENODEV; - goto error_free_gpadl; + goto error_clean_msglist; } ret = vmbus_post_msg(open_msg, -- 2.34.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/4828 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/Z... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/4828 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/Z...
participants (2)
-
patchwork bot
-
Zhang Xiaoxu