]> git.proxmox.com Git - mirror_qemu.git/commit
vhost-vsock: detach the virqueue element in case of error
authorStefano Garzarella <sgarzare@redhat.com>
Mon, 28 Feb 2022 09:50:58 +0000 (10:50 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 6 Mar 2022 10:08:23 +0000 (05:08 -0500)
commit8d1b247f3748ac4078524130c6d7ae42b6140aaf
tree8cf5d1d82e20ca7d479801b5e5d8e9baa9f24229
parent4ccd5fe22feb95137d325f422016a6473541fe9f
vhost-vsock: detach the virqueue element in case of error

In vhost_vsock_common_send_transport_reset(), if an element popped from
the virtqueue is invalid, we should call virtqueue_detach_element() to
detach it from the virtqueue before freeing its memory.

Fixes: fc0b9b0e1c ("vhost-vsock: add virtio sockets device")
Fixes: CVE-2022-26354
Cc: qemu-stable@nongnu.org
Reported-by: VictorV <vv474172261@gmail.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20220228095058.27899-1-sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost-vsock-common.c