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: <1253309513.1864.5.camel@yio.site>
Date:	Fri, 18 Sep 2009 23:31:53 +0200
From:	Kay Sievers <kay.sievers@...y.org>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>, Greg KH <greg@...ah.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [bug] /etc/profile: line 30: /dev/null: Permission denied

On Fri, 2009-09-18 at 13:58 -0700, Eric W. Biederman wrote:
> As a special case you can implement this much
> more simply in devtmpfs_mount just do:

I sent the patch to Greg already. I like to keep the things in the
subsystem where the non-default names are set. The issue will come back
from the embedded guys, who want to do be able to do that for a few more
nodes and run their stuff completely without userspace /dev. We are also
sure never to touch anything we did not create.

> int devtmpfs_mount(const char *mountpoint)
> {
>         sys_mount("none", "dev", "devtmpfs", MS_SILENT, NULL);
> 	sys_chmod("dev/console", 0666);
> 	sys_chmod("dev/tty", 0666);
> 	sys_chmod("dev/null", 0666);
> 	sys_chmod("dev/zero", 0666);
> }
> 
> Not using sys_mount is the problem Christoph was complaining about.
> 
> Grafting dev_mount into the global namespace (instead of making
> a copy and grafting that is pretty hideous).   It means that
> vfs_path_lookup will follow mounts, and it is a reference counting
> problem.

Ah, thanks.

> You can probably oops the kernel by going into single
> user mode and unmounting devtmpfs as the code stands right now.

It's busy here, and looks fine.



This change works for me here. Do you want to send or sign that off? :)

Thanks a lot,
Kay

---
 devtmpfs.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index fd488ad..685fc05 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -316,7 +316,6 @@ out:
  */
 int devtmpfs_mount(const char *mountpoint)
 {
-	struct path path;
 	int err;
 
 	if (!dev_mount)
@@ -325,15 +324,11 @@ int devtmpfs_mount(const char *mountpoint)
 	if (!dev_mnt)
 		return 0;
 
-	err = kern_path(mountpoint, LOOKUP_FOLLOW, &path);
-	if (err)
-		return err;
-	err = do_add_mount(dev_mnt, &path, 0, NULL);
+	err = sys_mount("none", mountpoint, "devtmpfs", MS_SILENT, NULL);
 	if (err)
 		printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
 	else
 		printk(KERN_INFO "devtmpfs: mounted\n");
-	path_put(&path);
 	return err;
 }
 


--
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