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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 5 Feb 2024 21:06:54 +0000
From: Ashish Kalra <Ashish.Kalra@....com>
To: <x86@...nel.org>
CC: <iommu@...ts.linux.dev>, <linux-kernel@...r.kernel.org>, <bp@...en8.de>,
	<thomas.lendacky@....com>, <michael.roth@....com>, <dan.carpenter@...aro.org>
Subject: [PATCH] iommu/amd: Fix failure return from snp_lookup_rmpentry().

From: Ashish Kalra <ashish.kalra@....com>

The patch f366a8dac1b8: "iommu/amd: Clean up RMP entries for IOMMU
pages during SNP shutdown" (linux-next), leads to the following
Smatch static checker warning:

	drivers/iommu/amd/init.c:3820 iommu_page_make_shared()
	error: uninitialized symbol 'assigned'.

Fix it.

Fixes: f366a8dac1b8 ("iommu/amd: Clean up RMP entries for IOMMU pages during SNP shutdown")
Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
Closes: https://lore.kernel.org/linux-iommu/1be69f6a-e7e1-45f9-9a74-b2550344f3fd@moroto.mountain/
Signed-off-by: Ashish Kalra <ashish.kalra@....com>
Link: https://lore.kernel.org/lkml/20240126041126.1927228-20-michael.roth@amd.com/
---
 drivers/iommu/amd/init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 88bb08ae39b2..11340380111d 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -3813,9 +3813,11 @@ static int iommu_page_make_shared(void *page)
 		bool assigned;
 
 		ret = snp_lookup_rmpentry(pfn, &assigned, &level);
-		if (ret)
+		if (ret) {
 			pr_warn("IOMMU PFN %lx RMP lookup failed, ret %d\n",
 				pfn, ret);
+			return ret;
+		}
 
 		if (!assigned)
 			pr_warn("IOMMU PFN %lx not assigned in RMP table\n",
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ