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>] [day] [month] [year] [list]
Date:   Sat,  2 Apr 2022 08:46:36 +0000
From:   cgel.zte@...il.com
To:     tglx@...utronix.de
Cc:     mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
        x86@...nel.org, hpa@...or.com, robh@...nel.org, lv.ruyi@....com.cn,
        frank.rowand@...y.com, linux-kernel@...r.kernel.org,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH] x86/devicetree: Fix refcount leak in dtb_lapic_setup

From: Lv Ruyi <lv.ruyi@....com.cn>

If dn is true that meas the of_find_compatible_node function 
successfully returns a node pointer with refcount incremented, 
use of_node_put() on it when done.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@....com.cn>
---
 arch/x86/kernel/devicetree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 5cd51f25f446..6498825cf48d 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -156,6 +156,7 @@ static void __init dtb_lapic_setup(void)
 	dn = of_find_compatible_node(NULL, NULL, "intel,ce4100-lapic");
 	if (dn) {
 		ret = of_address_to_resource(dn, 0, &r);
+		of_node_put(dn);
 		if (WARN_ON(ret))
 			return;
 		lapic_addr = r.start;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ