]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
vsock/virtio: fix kernel panic after device hot-unplug
authorStefano Garzarella <sgarzare@redhat.com>
Fri, 1 Feb 2019 11:42:06 +0000 (12:42 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit0fe6e3cf12695cd7f03da41b545f688468a2e9c2
treec3ba1529e52b4d1d86b7cec2af60da851f626f66
parentd78c70b86d4167564be1909bc7a139abea87c73a
vsock/virtio: fix kernel panic after device hot-unplug

BugLink: https://bugs.launchpad.net/bugs/1837813
[ Upstream commit 22b5c0b63f32568e130fa2df4ba23efce3eb495b ]

virtio_vsock_remove() invokes the vsock_core_exit() also if there
are opened sockets for the AF_VSOCK protocol family. In this way
the vsock "transport" pointer is set to NULL, triggering the
kernel panic at the first socket activity.

This patch move the vsock_core_init()/vsock_core_exit() in the
virtio_vsock respectively in module_init and module_exit functions,
that cannot be invoked until there are open sockets.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1609699
Reported-by: Yan Fu <yafu@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/vmw_vsock/virtio_transport.c