linux-stable/drivers/hv
Mohammed Gamal 176c6b4889 Drivers: vmbus: Check for channel allocation before looking up relids
[ Upstream commit 1eb65c8687 ]

relid2channel() assumes vmbus channel array to be allocated when called.
However, in cases such as kdump/kexec, not all relids will be reset by the host.
When the second kernel boots and if the guest receives a vmbus interrupt during
vmbus driver initialization before vmbus_connect() is called, before it finishes,
or if it fails, the vmbus interrupt service routine is called which in turn calls
relid2channel() and can cause a null pointer dereference.

Print a warning and error out in relid2channel() for a channel id that's invalid
in the second kernel.

Fixes: 8b6a877c06 ("Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels")

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Link: https://lore.kernel.org/r/20230217204411.212709-1-mgamal@redhat.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-20 12:10:21 +02:00
..
channel.c Drivers: hv: vmbus: Use after free in __vmbus_open() 2021-05-14 09:50:20 +02:00
channel_mgmt.c Drivers: hv: vmbus: fix double free in the error path of vmbus_add_channel_work() 2022-12-02 17:40:00 +01:00
connection.c Drivers: vmbus: Check for channel allocation before looking up relids 2023-04-20 12:10:21 +02:00
hv.c
hv_balloon.c hv_balloon: rate-limit "Unhandled message" warning 2022-04-08 14:40:19 +02:00
hv_debugfs.c
hv_fcopy.c
hv_kvp.c
hv_snapshot.c
hv_trace.c
hv_trace.h
hv_trace_balloon.h
hv_util.c hv_utils: Fix passing zero to 'PTR_ERR' warning 2021-07-14 16:55:57 +02:00
hv_utils_transport.c
hv_utils_transport.h
hyperv_vmbus.h hyperv/vmbus: include linux/bitops.h 2021-11-18 14:03:42 +01:00
Kconfig Revert "hv: utils: add PTP_1588_CLOCK to Kconfig to fix build" 2022-04-13 21:01:03 +02:00
Makefile
ring_buffer.c video: hyperv_fb: Avoid taking busy spinlock on panic path 2023-01-14 10:16:13 +01:00
vmbus_drv.c Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() 2022-12-02 17:40:00 +01:00