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:   Tue, 26 Jan 2021 14:51:59 +1300
From:   Chris Packham <chris.packham@...iedtelesis.co.nz>
To:     robh+dt@...nel.org, frowand.list@...il.com, arch0.zheng@...il.com
Cc:     devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        Chris Packham <chris.packham@...iedtelesis.co.nz>
Subject: [PATCH] of/fdt: Check against '/chosen' in early_init_dt_scan_chosen

of_scan_flat_dt() passes the name of the visited node to the iterator.
In the case of '/chosen' this includes the leading '/'. Update
early_init_dt_scan_chosen() to expect this.

Fixes: 7536c7e03e74 ("of/fdt: Remove redundant kbasename function call")
Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
---
 drivers/of/fdt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index feb0f2d67fc5..861aedf0bb7c 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1043,7 +1043,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
 	pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
 
 	if (depth != 1 || !data ||
-	    (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
+	    (strcmp(uname, "chosen") != 0 &&
+	     strcmp(uname, "chosen@0") != 0 &&
+	     strcmp(uname, "/chosen") != 0 &&
+	     strcmp(uname, "/chosen@0") != 0))
 		return 0;
 
 	early_init_dt_check_for_initrd(node);
-- 
2.30.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ