linux-stable/drivers/hv
Mohammed Gamal 1eb65c8687 Drivers: vmbus: Check for channel allocation before looking up relids
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>
2023-03-06 15:28:03 +00:00
..
Kconfig hv: utils: add PTP_1588_CLOCK to Kconfig to fix build 2021-11-28 21:22:35 +00:00
Makefile Drivers: hv: Move Hyper-V extended capability check to arch neutral code 2021-06-05 10:22:34 +00:00
channel.c Drivers: hv: vmbus: Introduce {lock,unlock}_requestor() 2022-04-25 15:51:13 +00:00
channel_mgmt.c Drivers: hv: vmbus: fix double free in the error path of vmbus_add_channel_work() 2022-11-21 10:57:41 +00:00
connection.c Drivers: vmbus: Check for channel allocation before looking up relids 2023-03-06 15:28:03 +00:00
hv.c Drivers: hv: Setup synic registers in case of nested root partition 2023-01-17 13:36:43 +00:00
hv_balloon.c hyperv-next for v6.3. 2023-02-21 16:59:23 -08:00
hv_common.c x86/hyperv: Add support for detecting nested hypervisor 2023-01-12 15:23:26 +00:00
hv_debugfs.c
hv_fcopy.c Drivers: hv: remove duplicate word in a comment 2022-09-05 16:28:40 +00:00
hv_kvp.c Drivers: hv: Fix syntax errors in comments 2022-06-08 12:26:28 +00:00
hv_snapshot.c hv_utils: Add comment about max VMbus packet size in VSS driver 2022-02-18 13:08:18 +00:00
hv_trace.c
hv_trace.h Drivers: hv: vmbus: Drivers: hv: vmbus: Introduce CHANNELMSG_MODIFYCHANNEL_RESPONSE 2021-04-18 13:03:11 +00:00
hv_trace_balloon.h
hv_util.c Drivers: hv: Make remove callback of hyperv driver void returned 2023-01-17 13:41:27 +00:00
hv_utils_transport.c Drivers: hv: utils: Make use of the helper macro LIST_HEAD() 2022-02-09 14:33:21 +00:00
hv_utils_transport.h
hyperv_vmbus.h Drivers: hv: vm_bus: Handle vmbus rescind calls after vmbus is suspended 2022-07-11 18:53:42 +00:00
ring_buffer.c video: hyperv_fb: Avoid taking busy spinlock on panic path 2022-11-28 16:48:20 +00:00
vmbus_drv.c Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00