Commit a0f1d21
KVM: use after free in kvm_ioctl_create_device()
We should move the ops->destroy(dev) after the list_del(&dev->vm_node)
so that we don't use "dev" after freeing it.
Fixes: a28ebea ("KVM: Protect device ops->create and list_add with kvm->lock")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>1 parent 0f4828a commit a0f1d21
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2889 | 2889 | | |
2890 | 2890 | | |
2891 | 2891 | | |
2892 | | - | |
2893 | 2892 | | |
2894 | 2893 | | |
2895 | 2894 | | |
| 2895 | + | |
2896 | 2896 | | |
2897 | 2897 | | |
2898 | 2898 | | |
| |||
0 commit comments