linux_dsm_epyc7002/drivers/hv
Andrea Parri (Microsoft) 71a6979d54 Drivers: hv: vmbus: Avoid use-after-free in vmbus_onoffer_rescind()
[ Upstream commit e3fa4b747f085d2cda09bba0533b86fa76038635 ]

When channel->device_obj is non-NULL, vmbus_onoffer_rescind() could
invoke put_device(), that will eventually release the device and free
the channel object (cf. vmbus_device_release()).  However, a pointer
to the object is dereferenced again later to load the primary_channel.
The use-after-free can be avoided by noticing that this load/check is
redundant if device_obj is non-NULL: primary_channel must be NULL if
device_obj is non-NULL, cf. vmbus_add_channel_work().

Fixes: 54a66265d6 ("Drivers: hv: vmbus: Fix rescind handling")
Reported-by: Juan Vazquez <juvazq@microsoft.com>
Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20201209070827.29335-5-parri.andrea@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-04 11:37:46 +01:00
..
channel_mgmt.c Drivers: hv: vmbus: Avoid use-after-free in vmbus_onoffer_rescind() 2021-03-04 11:37:46 +01:00
channel.c Drivers: hv: vmbus: Move virt_to_hvpfn() to hyperv header 2020-09-28 08:55:13 +00:00
connection.c
hv_balloon.c hyperv-fixes for 5.10-rc3 2020-11-05 11:32:03 -08:00
hv_debugfs.c
hv_fcopy.c
hv_kvp.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hv_snapshot.c
hv_trace_balloon.h
hv_trace.c
hv_trace.h
hv_util.c hyperv-next for 5.10 2020-10-14 10:32:10 -07:00
hv_utils_transport.c
hv_utils_transport.h
hv.c hyperv-fixes for 5.10-rc5 2020-11-16 15:02:33 -08:00
hyperv_vmbus.h
Kconfig
Makefile
ring_buffer.c
vmbus_drv.c x86/hyperv: Fix kexec panic/hang issues 2021-01-27 11:54:57 +01:00