Commit 22b5c0b
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>1 parent c14f07c commit 22b5c0b
1 file changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
584 | 587 | | |
585 | 588 | | |
586 | 589 | | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | 590 | | |
592 | 591 | | |
593 | 592 | | |
| |||
618 | 617 | | |
619 | 618 | | |
620 | 619 | | |
621 | | - | |
622 | | - | |
623 | 620 | | |
624 | 621 | | |
625 | 622 | | |
| |||
669 | 666 | | |
670 | 667 | | |
671 | 668 | | |
672 | | - | |
673 | 669 | | |
674 | 670 | | |
675 | 671 | | |
| |||
702 | 698 | | |
703 | 699 | | |
704 | 700 | | |
| 701 | + | |
705 | 702 | | |
706 | 703 | | |
707 | | - | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
708 | 716 | | |
| 717 | + | |
709 | 718 | | |
710 | 719 | | |
711 | 720 | | |
712 | 721 | | |
| 722 | + | |
713 | 723 | | |
714 | 724 | | |
715 | 725 | | |
| |||
0 commit comments