Skip to content
Commit c373e49f authored by Mohammed Gamal's avatar Mohammed Gamal Committed by Greg Kroah-Hartman
Browse files

Drivers: vmbus: Check for channel allocation before looking up relids

[ Upstream commit 1eb65c86 ]

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: 8b6a877c

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

Signed-off-by: default avatarMohammed Gamal <mgamal@redhat.com>
Reviewed-by: default avatarDexuan Cui <decui@microsoft.com>
Link: https://lore.kernel.org/r/20230217204411.212709-1-mgamal@redhat.com
Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b50cd678
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment