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:   Thu, 18 Jan 2018 10:43:39 +0000
From:   Sudeep Holla <sudeep.holla@....com>
To:     devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Sudeep Holla <sudeep.holla@....com>,
        Loys Ollivier <lollivier@...libre.com>,
        Andy Gross <andy.gross@...aro.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>
Subject: [PATCH -next] of: platform: fix OF node refcount leak

We need to call of_node_put() for device nodes obtained with
of_find_node_by_path().

Fixes: 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()")
Reported-by: Loys Ollivier <lollivier@...libre.com>
Cc: Rob Herring <robh+dt@...nel.org>
Cc: Frank Rowand <frowand.list@...il.com>
Signed-off-by: Sudeep Holla <sudeep.holla@....com>
---
 drivers/of/platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Hi Rob,

You had Acked the original patch and it's queued via ARM SoC. So can you
please provide ack on this if you are OK with the change.

Regards,
Sudeep

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 6a01dab597c7..c00d81dfac0b 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -514,8 +514,10 @@ static int __init of_platform_default_populate_init(void)
 		of_platform_device_create(node, NULL, NULL);

 	node = of_find_node_by_path("/firmware");
-	if (node)
+	if (node) {
 		of_platform_populate(node, NULL, NULL, NULL);
+		of_node_put(node);
+	}

 	/* Populate everything else. */
 	of_platform_default_populate(NULL, NULL, NULL);
--
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ