]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
Drivers: hv: vmbus: Fix potential crash on module unload
authorGuilherme G. Piccoli <gpiccoli@igalia.com>
Tue, 15 Mar 2022 20:35:35 +0000 (17:35 -0300)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:59:29 +0000 (11:59 +0200)
commit02302672f52b8703471fa777e62b5e51213d80e7
treeadad56afc6bffdaeb678fb0f667f4dedae80730d
parent35adbd74a25c315474a332d01533ad256f8632a6
Drivers: hv: vmbus: Fix potential crash on module unload

BugLink: https://bugs.launchpad.net/bugs/1969107
[ Upstream commit 792f232d57ff28bbd5f9c4abe0466b23d5879dc8 ]

The vmbus driver relies on the panic notifier infrastructure to perform
some operations when a panic event is detected. Since vmbus can be built
as module, it is required that the driver handles both registering and
unregistering such panic notifier callback.

After commit 74347a99e73a ("x86/Hyper-V: Unload vmbus channel in hv panic callback")
though, the panic notifier registration is done unconditionally in the module
initialization routine whereas the unregistering procedure is conditionally
guarded and executes only if HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE capability
is set.

This patch fixes that by unconditionally unregistering the panic notifier
in the module's exit routine as well.

Fixes: 74347a99e73a ("x86/Hyper-V: Unload vmbus channel in hv panic callback")
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20220315203535.682306-1-gpiccoli@igalia.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit dcd6b1a624c0ffa21034d8b1e02e9d068458f596)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/hv/vmbus_drv.c