FS#40815 - [linux] [util-linux] Regression, file system namespace no longer work
Attached to Project:
Arch Linux
Opened by Rong (tr071) - Thursday, 12 June 2014, 00:14 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 12 June 2014, 04:26 GMT
Opened by Rong (tr071) - Thursday, 12 June 2014, 00:14 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 12 June 2014, 04:26 GMT
|
Details
Description:
The "unshare" command was used to create new namespaces. But now no new ns is created. Additional info: * package version(s) Linux: 3.14.6-1 Util-linux: 2.24.2-1 * config and/or log files etc. Steps to reproduce: >>sudo unshare -m #This should give a shell with new fs >>mount -t tmpfs tmpfs /usr/local && mount # This command should print the mount table with "/usr/local" mounted as tmpfs Now go to another tty and type: >>mount What is supposed to happen: "/usr/local" should not show up in the second shell. What is actually happened: "/usr/local" showed up, indicating there is no new filesystem namespace created after "unshare -m" |
This task depends upon
If you don't want mounts propagating back to the master, then you can bind mount a directory on itself and make it a slave (or private). Then, mounts on the bind mounted directory will not be propagated.
I found it very annoying to allow the child namespace to pollute its parent, as it totally defeats the purpose of namespace. Moreover, a child could bind mount files like passwd/shadow/sshd_config or any evil stuff, thus cause a security breach. It also does not make any sense in uid namespaces, if arch is going to enable it someday.
> a child could bind mount files like passwd/shadow/sshd_config or any evil stuff, thus cause a security breach.
Well sure, an insecure setup is insecure. If you don't want this happening in a given setup, change the propagation flags. Don't think that mount namespaces are ever going to provide any real security on their own, though.
I'm not sure about this. Isn't namespace the cornerstone of the hottest projects like docker? I heard google is trying to offer docker containers to the the public, so they must have good faith in it. Namespaces(including UID_NS) are also enabled in the ChromeOS, which put quite a lot of thoughts and efforts on security.
Even there are tons of potential security bugs in the kernel, the kernel gurus will fix them upon disclosed. But systemd is intentionally creating a security problem which is trivial to take advantage of. To make things worse, the is neither warning at all when I run the "unshare", nor any way to check if rootfs is rshared.
I changed my rootfs as --make-rprivate, and so far so good. It makes me wonder if Mr Poettering is working for the NSA...