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>] [day] [month] [year] [list]
Message-ID: <PA4P189MB1421C0EB9620ACD70D87A1698BF09@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM>
Date:   Sun, 17 Apr 2022 07:48:43 +0500
From:   Saud Farooqui <farooqui_saud@...mail.com>
To:     jgg@...pe.ca, kevin.tian@...el.com, joro@...tes.org,
        will@...nel.org
Cc:     Saud Farooqui <farooqui_saud@...mail.com>,
        iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
        kernel test robot <lkp@...el.com>,
        Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH] iommufd: unlock ictx->vfio_compat before return.

cocci warning: drivers/iommu/iommufd/vfio_compat.c:494:2-8: preceding
lock on line 491

Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Julia Lawall <julia.lawall@...6.fr>
Signed-off-by: Saud Farooqui <farooqui_saud@...mail.com>
---
 drivers/iommu/iommufd/vfio_compat.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/iommufd/vfio_compat.c b/drivers/iommu/iommufd/vfio_compat.c
index 5b196de00ff9..d9347df48cc8 100644
--- a/drivers/iommu/iommufd/vfio_compat.c
+++ b/drivers/iommu/iommufd/vfio_compat.c
@@ -491,8 +491,10 @@ void vfio_group_unset_iommufd(void *iommufd, struct list_head *device_list)
 		return;
 	mutex_lock(&ictx->vfio_compat);
 	ioas = get_compat_ioas(ictx);
-	if (IS_ERR(ioas))
+	if (IS_ERR(ioas)) {
+		mutex_unlock(&ictx->vfio_compat);
 		return;
+	}
 
 	ioas_id = ioas->obj.id;
 	iommufd_put_object(&ioas->obj);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ