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: <20251110204529.2838248-1-dianders@chromium.org>
Date: Mon, 10 Nov 2025 12:45:26 -0800
From: Douglas Anderson <dianders@...omium.org>
To: Rob Herring <robh@...nel.org>,
	Saravana Kannan <saravanak@...gle.com>
Cc: devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Douglas Anderson <dianders@...omium.org>
Subject: [PATCH 1/2] checks: Allow "__overlay__" node at the root of an overlay fragment

Checking a `dtso` file will give the following warning:
  Warning (node_name_chars_strict): /fragment@<num>/__overlay__: Character '_' not recommended in node name

Add the node named "__overlay__" at the root of a fragment as a
special case to not warn about.

Signed-off-by: Douglas Anderson <dianders@...omium.org>
---

 checks.c | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/checks.c b/checks.c
index 5d092164ee12..908df5b98ec5 100644
--- a/checks.c
+++ b/checks.c
@@ -192,6 +192,25 @@ out:
 	return error;
 }
 
+/* Return the path after "/fragment@<num>" or NULL if path doesn't start "/fragment@<num>/"" */
+static const char *get_fragment_relative_path(const char *fullpath)
+{
+	const char *p;
+
+	if (strncmp(fullpath, "/fragment@", 10) != 0)
+		return NULL;
+
+	p = &(fullpath[10]);
+	if (!isdigit(*p))
+		return NULL;
+	while (isdigit(*p))
+		p++;
+	if (*p != '/')
+		return NULL;
+
+	return p;
+}
+
 /*
  * Utility check functions
  */
@@ -324,8 +343,20 @@ ERROR(node_name_chars, check_node_name_chars, NODECHARS);
 static void check_node_name_chars_strict(struct check *c, struct dt_info *dti,
 					 struct node *node)
 {
-	int n = strspn(node->name, c->data);
+	int n;
+
+	/*
+	 * The node named "__overlay__" is allowed at the root of a fragment
+	 * in an overlay.
+	 */
+	if (dti->dtsflags & DTSF_PLUGIN) {
+		const char *frag_path = get_fragment_relative_path(node->fullpath);
+
+		if (frag_path && streq(frag_path, "/__overlay__"))
+			return;
+	}
 
+	n = strspn(node->name, c->data);
 	if (n < node->basenamelen)
 		FAIL(c, dti, node, "Character '%c' not recommended in node name",
 		     node->name[n]);
-- 
2.51.2.1041.gc1ab5b90ca-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ