diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-04-13 13:50:04 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-14 10:50:20 +0300 |
commit | d5c7b42c9f56ca46b286daa537d181bd7f69214f (patch) | |
tree | 2fd1c6ed0aa4890d4d623e6e4fa725c40b08a849 /drivers/hv | |
parent | b49bdd70b337b0a34892dc40b8d5c6210ecc64e7 (diff) | |
download | linux-d5c7b42c9f56ca46b286daa537d181bd7f69214f.tar.xz |
Drivers: hv: vmbus: Use after free in __vmbus_open()
[ Upstream commit 3e9bf43f7f7a46f21ec071cb47be92d0874c48da ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r-- | drivers/hv/channel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index fbdda9938039..f064fa6ef181 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -583,7 +583,7 @@ static int __vmbus_open(struct vmbus_channel *newchannel, if (newchannel->rescind) { err = -ENODEV; - goto error_free_info; + goto error_clean_msglist; } err = vmbus_post_msg(open_msg, |