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]
Message-Id: <20230403-regmap-maple-unlock-v1-1-89998991b16c@kernel.org>
Date:   Mon, 03 Apr 2023 21:02:39 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Liam.Howlett@...cle.com
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Mark Brown <broonie@...nel.org>
Subject: [PATCH] regmap: Fix double unlock in the maple cache

Doing the dance to drop the maple tree's internal spinlock means we need
multiple exit paths in our error handling.

Reported-by: Liam R. Howlett <Liam.Howlett@...cle.com>
Signed-off-by: Mark Brown <broonie@...nel.org>
---
 drivers/base/regmap/regcache-maple.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c
index 497cc708d277..20fb7228fc6b 100644
--- a/drivers/base/regmap/regcache-maple.c
+++ b/drivers/base/regmap/regcache-maple.c
@@ -137,7 +137,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
 					GFP_KERNEL);
 			if (!lower) {
 				ret = -ENOMEM;
-				goto out;
+				goto out_unlocked;
 			}
 		}
 
@@ -151,7 +151,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
 					GFP_KERNEL);
 			if (!upper) {
 				ret = -ENOMEM;
-				goto out;
+				goto out_unlocked;
 			}
 		}
 
@@ -179,6 +179,7 @@ static int regcache_maple_drop(struct regmap *map, unsigned int min,
 
 out:
 	mas_unlock(&mas);
+out_unlocked:
 	kfree(lower);
 	kfree(upper);
 

---
base-commit: f033c26de5a5734625d2dd1dc196745fae186f1b
change-id: 20230403-regmap-maple-unlock-98aa84cc47f5

Best regards,
-- 
Mark Brown <broonie@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ