Commit e16fb48a authored by Dan Carpenter's avatar Dan Carpenter Committed by Zhang Xiaoxu
Browse files

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

mainline inclusion
from mainline-v5.13-rc1
commit 3e9bf43f
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: 6f3d791f ("Drivers: hv: vmbus: Fix rescind handling issues")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarAndrea Parri <parri.andrea@gmail.com>
Link: https://lore.kernel.org/r/YHV3XLCot6xBS44r@mwanda


Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>

Conflicts:
	drivers/hv/channel.c

Signed-off-by: default avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
parent a828e118
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,