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: <1438262237-30889-2-git-send-email-rabel@cit-ec.uni-bielefeld.de>
Date:	Thu, 30 Jul 2015 15:17:17 +0200
From:	Robert ABEL <rabel@...-ec.uni-bielefeld.de>
To:	akpm@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
	Robert ABEL <rabel@...-ec.uni-bielefeld.de>
Subject: [PATCH] of: resource: add WARN for invalid release_resource calls

Signed-off-by: Robert ABEL <rabel@...-ec.uni-bielefeld.de>
---
 kernel/resource.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/resource.c b/kernel/resource.c
index 0bcebff..b4c9b27 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -236,6 +236,13 @@ static int __release_resource(struct resource *old)
 {
 	struct resource *tmp, **p;
 
+    /* devicetree overlays:
+     * of code doesn't initialize parent, child, sibling
+     * gracefully 'do the right thing' here
+     */
+	if (WARN(!old->parent, "%s: uninitialized resource %s\n", __FUNCTION__, old->name))
+		return 0;
+
 	p = &old->parent->child;
 	for (;;) {
 		tmp = *p;
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ