summaryrefslogtreecommitdiffstats
path: root/drivers/vfio
diff options
context:
space:
mode:
authorIlya Lesokhin2016-07-14 15:50:19 +0200
committerAlex Williamson2016-07-14 22:28:16 +0200
commitd370c917b9d4bef71e5d994aac5547f06f4dd76f (patch)
tree99038bc153212fb914f3ce1987360443ac3641df /drivers/vfio
parentvfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive (diff)
downloadkernel-qcow2-linux-d370c917b9d4bef71e5d994aac5547f06f4dd76f.tar.gz
kernel-qcow2-linux-d370c917b9d4bef71e5d994aac5547f06f4dd76f.tar.xz
kernel-qcow2-linux-d370c917b9d4bef71e5d994aac5547f06f4dd76f.zip
vfio: fix possible use after free of vfio group
The vfio group should be released after the vfio_group_try_dissolve_container call. The code should not rely on someone else to hold a reference on the group. Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/vfio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 6fd6fa5469de..d1d70e0b011b 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -1711,8 +1711,8 @@ EXPORT_SYMBOL_GPL(vfio_group_get_external_user);
void vfio_group_put_external_user(struct vfio_group *group)
{
- vfio_group_put(group);
vfio_group_try_dissolve_container(group);
+ vfio_group_put(group);
}
EXPORT_SYMBOL_GPL(vfio_group_put_external_user);