lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 29 Jun 2022 10:05:00 +0800
From:   Lei Rao <lei.rao@...el.com>
To:     alex.williamson@...hat.com, cohuck@...hat.com,
        kevin.tian@...el.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Lei Rao <lei.rao@...el.com>
Subject: [PATCH] vfio: Fix memory leaks in vfio_create_group()

If an error occurs after vfio_group_alloc(), we need to release the
group.

Signed-off-by: Lei Rao <lei.rao@...el.com>
---
 drivers/vfio/vfio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 61e71c1154be..2460aec44a6d 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -414,6 +414,7 @@ static struct vfio_group *vfio_create_group(struct iommu_group *iommu_group,
 	mutex_unlock(&vfio.group_lock);
 err_put:
 	put_device(&group->dev);
+	vfio_group_release(&group->dev);
 	return ret;
 }
 
-- 
2.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ