linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] vsock/virtio: several fixes in the .probe() and .remove()
@ 2019-06-28 12:36 Stefano Garzarella
  2019-06-28 12:36 ` [PATCH v2 1/3] vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock Stefano Garzarella
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Stefano Garzarella @ 2019-06-28 12:36 UTC (permalink / raw)
  To: netdev
  Cc: kvm, virtualization, Stefan Hajnoczi, Michael S. Tsirkin,
	David S. Miller, Jason Wang, linux-kernel

During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.

This series tries to solve these issues:
- Patch 1 adds RCU critical sections to avoid use-after-free of
  'the_virtio_vsock' pointer.
- Patch 2 stops workers before to call vdev->config->reset(vdev) to
  be sure that no one is accessing the device.
- Patch 3 moves the works flush at the end of the .remove() to avoid
  use-after-free of 'vsock' object.

v2:
- Patch 1: use RCU to protect 'the_virtio_vsock' pointer
- Patch 2: no changes
- Patch 3: flush works only at the end of .remove()
- Removed patch 4 because virtqueue_detach_unused_buf() returns all the buffers
  allocated.

v1: https://patchwork.kernel.org/cover/10964733/

Stefano Garzarella (3):
  vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock
  vsock/virtio: stop workers during the .remove()
  vsock/virtio: fix flush of works during the .remove()

 net/vmw_vsock/virtio_transport.c | 131 ++++++++++++++++++++++++-------
 1 file changed, 102 insertions(+), 29 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-07-05  0:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 12:36 [PATCH v2 0/3] vsock/virtio: several fixes in the .probe() and .remove() Stefano Garzarella
2019-06-28 12:36 ` [PATCH v2 1/3] vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock Stefano Garzarella
2019-07-01 14:54   ` Stefan Hajnoczi
2019-07-01 15:10   ` Stefan Hajnoczi
2019-07-03  9:53   ` Jason Wang
2019-07-03 10:41     ` Stefano Garzarella
2019-07-04  3:58       ` Jason Wang
2019-07-04  9:20         ` Stefano Garzarella
2019-07-05  0:18           ` Jason Wang
2019-07-04 10:17       ` Stefan Hajnoczi
2019-06-28 12:36 ` [PATCH v2 2/3] vsock/virtio: stop workers during the .remove() Stefano Garzarella
2019-07-04  4:00   ` Jason Wang
2019-06-28 12:36 ` [PATCH v2 3/3] vsock/virtio: fix flush of works " Stefano Garzarella
2019-07-01 15:08   ` Stefan Hajnoczi
2019-07-01 15:09   ` Stefan Hajnoczi
2019-07-01 15:11 ` [PATCH v2 0/3] vsock/virtio: several fixes in the .probe() and .remove() Stefan Hajnoczi
2019-07-01 17:03   ` Stefano Garzarella
2019-07-03  9:14     ` Stefan Hajnoczi
2019-07-03 10:07       ` Stefano Garzarella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).