]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Feb 2019 19:06:25 +0000 (11:06 -0800)
commite12dfe207f62fb42e68f7f779e21446eb23c150a
treebc9447293bc9ae92fcbf10db6dd3352ff3378fdd
parent301a48862704924ce0d216c85970f69d98b062ef
vsock/virtio: fix kernel panic after device hot-unplug

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>
net/vmw_vsock/virtio_transport.c