Re: [bug] /etc/profile: line 30: /dev/null: Permission denied

From: Eric W. Biederman
Date: Fri Sep 18 2009 - 16:58:28 EST



As a special case you can implement this much
more simply in devtmpfs_mount just do:

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. You can probably oops the kernel by going into single
user mode and unmounting devtmpfs as the code stands right now.

Eric


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