virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze
authorAsias He <asias.hejun@gmail.com>
Wed, 15 Jan 2014 23:48:48 +0000 (10:18 +1030)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Feb 2014 19:22:21 +0000 (11:22 -0800)
commitf2d6b1bada7ce0e72258302dbd365e89b4578986
treef8c1a27f751d2b8688be8b85c252248d73977ed4
parente88fcbf2e77942ae29ec1fb2c387363b5ac5ef31
virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze

commit f466f75385369a181409e46da272db3de6f5c5cb upstream.

vqs are freed in virtscsi_freeze but the hotcpu_notifier is not
unregistered. We will have a use-after-free usage when the notifier
callback is called after virtscsi_freeze.

Fixes: 285e71ea6f3583a85e27cb2b9a7d8c35d4c0d558
("virtio-scsi: reset virtqueue affinity when doing cpu hotplug")

Signed-off-by: Asias He <asias.hejun@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/virtio_scsi.c