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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260112142009.1006236-51-herve.codina@bootlin.com>
Date: Mon, 12 Jan 2026 15:19:40 +0100
From: Herve Codina <herve.codina@...tlin.com>
To: David Gibson <david@...son.dropbear.id.au>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>
Cc: Ayush Singh <ayush@...gleboard.org>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	devicetree-compiler@...r.kernel.org,
	devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	devicetree-spec@...r.kernel.org,
	Hui Pu <hui.pu@...ealthcare.com>,
	Ian Ray <ian.ray@...ealthcare.com>,
	Luca Ceresoli <luca.ceresoli@...tlin.com>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
	Herve Codina <herve.codina@...tlin.com>
Subject: [RFC PATCH 50/77] dtc: Handle orphan nodes in mark_local_xxx() and update_xxx_ref()

Orphan nodes have been introduced recently.

mark_local_phandles() and mark_local_exports() mark phandles and export
symbols as local when they reference a local node (i.e. a node in the
current device-tree).

update_phandles_ref() and update_exports_ref() update references
pointing to local nodes.

Those phandles, export symbols and references can involve orphan trees.

Indeed, even if an orphan node itself is not present in the current
device-tree, its subnodes are fully described in the current device-tree
and so, those subnodes have to be considered as local nodes.

Update those functions to handle orphan nodes.

Signed-off-by: Herve Codina <herve.codina@...tlin.com>
---
 livetree.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/livetree.c b/livetree.c
index fa9daff..52c55be 100644
--- a/livetree.c
+++ b/livetree.c
@@ -1481,7 +1481,12 @@ static void update_phandles_ref_internal(struct dt_info *dti, struct node *node)
 
 void update_phandles_ref(struct dt_info *dti)
 {
+	struct node *orphan;
+
 	update_phandles_ref_internal(dti, dti->dt);
+
+	for_each_orphan(dti->orphanlist, orphan)
+		update_phandles_ref_internal(dti, orphan);
 }
 
 static void mark_local_phandles_internal(struct dt_info *dti,
@@ -1507,7 +1512,12 @@ static void mark_local_phandles_internal(struct dt_info *dti,
 
 void mark_local_phandles(struct dt_info *dti)
 {
+	struct node *orphan;
+
 	mark_local_phandles_internal(dti, dti->dt);
+
+	for_each_orphan(dti->orphanlist, orphan)
+		mark_local_phandles_internal(dti, orphan);
 }
 
 static void update_exports_ref_internal(struct dt_info *dti, struct node *node)
@@ -1537,7 +1547,12 @@ static void update_exports_ref_internal(struct dt_info *dti, struct node *node)
 
 void update_exports_ref(struct dt_info *dti)
 {
+	struct node *orphan;
+
 	update_exports_ref_internal(dti, dti->dt);
+
+	for_each_orphan(dti->orphanlist, orphan)
+		update_exports_ref_internal(dti, orphan);
 }
 
 static void mark_local_exports_internal(struct dt_info *dti,
@@ -1559,6 +1574,10 @@ static void mark_local_exports_internal(struct dt_info *dti,
 
 void mark_local_exports(struct dt_info *dti)
 {
+	struct node *orphan;
+
 	mark_local_exports_internal(dti, dti->dt);
 
+	for_each_orphan(dti->orphanlist, orphan)
+		mark_local_exports_internal(dti, orphan);
 }
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ