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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
1 parent b2c8b64 commit e07754e

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

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)