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: <20120514164106.GB4439@redhat.com>
Date:	Mon, 14 May 2012 12:41:06 -0400
From:	Dave Jones <davej@...hat.com>
To:	Linux Kernel <linux-kernel@...r.kernel.org>
Cc:	Fedora Kernel Team <kernel-team@...oraproject.org>,
	Al Viro <viro@...IV.linux.org.uk>,
	Paul Mackerras <paulus@...ba.org>
Subject: Remove empty /proc/device-tree when no openfirmware exists.

distribution kernels might want to build in support for /proc/device-tree
for kernels that might end up running on hardware that doesn't support openfirmware.
This results in an empty /proc/device-tree existing.
Remove it if the OFW root node doesn't exist.

[This situation actually confuses grub2, resulting in install failures.
 grub2 sees the /proc/device-tree and picks the wrong install target
 cf. http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/4300/util/grub-install.in#L311
 grub should be more robust, but still, leaving an empty proc dir seems pointless. ]

Signed-off-by: Dave Jones <davej@...hat.com>

diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index 927cbd1..f060f28 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -233,6 +233,7 @@ void __init proc_device_tree_init(void)
 		return;
 	root = of_find_node_by_path("/");
 	if (root == NULL) {
+		remove_proc_entry("device-tree", NULL);
 		pr_debug("/proc/device-tree: can't find root\n");
 		return;
 	}
--
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