Skip to content

Commit e07754e

Browse files
Dan Carpentermstsirkin
authored andcommitted
vhost-vdpa: fix use after free in vhost_vdpa_probe()
The put_device() calls vhost_vdpa_release_dev() which calls ida_simple_remove() and frees "v". So this call to ida_simple_remove() is a use after free and a double free. Fixes: ebe6a35 ("vhost-vdpa: Call ida_simple_remove() when failed") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Message-Id: <cf53cb61-0699-4e36-a980-94fd4268ff00@moroto.mountain> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
1 parent b2c8b64 commit e07754e

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

drivers/vhost/vdpa.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,6 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
15821582

15831583
err:
15841584
put_device(&v->dev);
1585-
ida_simple_remove(&vhost_vdpa_ida, v->minor);
15861585
return r;
15871586
}
15881587

0 commit comments

Comments
 (0)