kernel-hacking-2024-linux-s.../drivers/vhost
Michael S. Tsirkin dd7633ecd5 vhost-net: fix use-after-free in vhost_net_flush
vhost_net_ubuf_put_and_wait has a confusing name:
it will actually also free it's argument.
Thus since commit 1280c27f8e
    "vhost-net: flush outstanding DMAs on memory change"
vhost_net_flush tries to use the argument after passing it
to vhost_net_ubuf_put_and_wait, this results
in use after free.
To fix, don't free the argument in vhost_net_ubuf_put_and_wait,
add an new API for callers that want to free ubufs.

Acked-by: Asias He <asias@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-09 12:55:48 -07:00
..
Kconfig Lots of virtio work which wasn't quite ready for last merge window. Plus 2013-05-02 14:14:04 -07:00
Makefile Lots of virtio work which wasn't quite ready for last merge window. Plus 2013-05-02 14:14:04 -07:00
net.c vhost-net: fix use-after-free in vhost_net_flush 2013-07-09 12:55:48 -07:00
scsi.c vhost-scsi: Enable VIRTIO_RING_F_EVENT_IDX 2013-05-07 11:11:08 +03:00
test.c Lots of virtio work which wasn't quite ready for last merge window. Plus 2013-05-02 14:14:04 -07:00
test.h
vhost.c vhost: check owner before we overwrite ubuf_info 2013-06-11 02:46:21 -07:00
vhost.h vhost: check owner before we overwrite ubuf_info 2013-06-11 02:46:21 -07:00
vringh.c Add missing module license tag to vring helpers. 2013-05-08 10:49:03 +09:30