History

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.

Dan Carpenter committed 3 years ago

Commit e07754e1 parent b2c8b641 file · +0 −1Browse files

Unified · Split

drivers/vhost/vdpa.c+0−1
@@ -1582,7 +1582,6 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa) · 1581 unmodified lines
1582 1582
1583err:1583err:
1584 put_device(&v->dev);1584 put_device(&v->dev);
1585 ida_simple_remove(&vhost_vdpa_ida, v->minor);
1586 return r;1585 return r;
1587}1586}
1588 1587

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t