Skip to content
Commit e152d8af authored by Dan Carpenter's avatar Dan Carpenter Committed by Michael S. Tsirkin
Browse files

virtio_ring: Fix two use after free bugs

The "vq" struct is added to the "vdev->vqs" list prematurely.  If we
encounter an error later in the function then the "vq" is freed, but
since it is still on the list that could lead to a use after free bug.

Fixes: cbeedb72

 ("virtio_ring: allocate desc state for split ring separately")
Reported-by: default avatarRobert Buhren <robert.buhren@sect.tu-berlin.de>
Reported-by: default avatarFelicitas Hetzelt <file@sect.tu-berlin.de>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X8pGaG/zkI3jk8mk@mwanda


Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
parent 411ea23a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment