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

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.c Drivers: hv: vmbus: Move virt_to_hvpfn() to hyperv header 2020-09-28 08:55:13 +00:00
channel_mgmt.c Drivers: hv: vmbus: Avoid use-after-free in vmbus_onoffer_rescind() 2021-03-04 11:37:46 +01:00
connection.c Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels 2020-04-23 13:17:11 +00:00
hv.c hyperv-fixes for 5.10-rc5 2020-11-16 15:02:33 -08:00
hv_balloon.c hyperv-fixes for 5.10-rc3 2020-11-05 11:32:03 -08:00
hv_debugfs.c hv_debugfs: Make hv_debug_root static 2020-04-04 17:47:43 +01:00
hv_fcopy.c hv_utils: Always execute the fcopy and vss callbacks in a tasklet 2020-04-23 13:17:11 +00:00
hv_kvp.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hv_snapshot.c hv_utils: Always execute the fcopy and vss callbacks in a tasklet 2020-04-23 13:17:11 +00:00
hv_trace.c hv: add SPDX license to trace 2018-03-28 13:24:56 +02:00
hv_trace.h hyperv-next for 5.8 2020-06-03 15:00:05 -07:00
hv_trace_balloon.h hv_balloon: trace post_status 2018-03-06 09:57:17 -08:00
hv_util.c hyperv-next for 5.10 2020-10-14 10:32:10 -07:00
hv_utils_transport.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 280 2019-06-05 17:36:36 +02:00
hv_utils_transport.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 280 2019-06-05 17:36:36 +02:00
hyperv_vmbus.h Drivers: hv: vmbus: Resolve more races involving init_vp_index() 2020-05-23 09:07:00 +00:00
Kconfig clocksource/drivers/hyperv: Enable TSC page clocksource on 32bit 2019-08-23 16:59:54 +02:00
Makefile drivers: hv: vmbus: Introduce latency testing 2019-11-21 20:10:44 -05:00
ring_buffer.c drivers: hv: vmbus: Introduce latency testing 2019-11-21 20:10:44 -05:00
vmbus_drv.c x86/hyperv: Fix kexec panic/hang issues 2021-01-27 11:54:57 +01:00