[opensuse-kernel] New mount restriction?
Hello. It seems to me that "mount --move /tmp/old/ /tmp/new/" is not working on opensuse 12.3 kernel. linux:~ # uname -r 3.7.10-1.1-desktop linux:~ # mkdir -p /tmp/old/ /tmp/new/ linux:~ # mount -t tmpfs none /tmp/old/ linux:~ # mount --move /tmp/old/ /tmp/new/ mount: wrong fs type, bad option, bad superblock on /tmp/old, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so strace says mount("/tmp/old", "/tmp/new", 0xb7c34168, MS_MGC_VAL|MS_MOVE, NULL) = -1 EINVAL (Invalid argument) Is this a bug (or is this caused by yama-like restriction mechanism)? Regards. -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On 4/8/13 8:49 AM, Tetsuo Handa wrote:
Hello.
It seems to me that "mount --move /tmp/old/ /tmp/new/" is not working on opensuse 12.3 kernel.
linux:~ # uname -r 3.7.10-1.1-desktop linux:~ # mkdir -p /tmp/old/ /tmp/new/ linux:~ # mount -t tmpfs none /tmp/old/ linux:~ # mount --move /tmp/old/ /tmp/new/ mount: wrong fs type, bad option, bad superblock on /tmp/old, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so
strace says
mount("/tmp/old", "/tmp/new", 0xb7c34168, MS_MGC_VAL|MS_MOVE, NULL) = -1 EINVAL (Invalid argument)
Is this a bug (or is this caused by yama-like restriction mechanism)?
Do you know the last kernel where this worked as you expect? I've tested vanilla kernels from 3.0 to 3.9-rc4 and it behaves as you describe in your test. -Jeff -- Jeff Mahoney SUSE Labs
В Mon, 08 Apr 2013 11:37:14 -0400 Jeff Mahoney <jeffm@suse.com> пишет:
On 4/8/13 8:49 AM, Tetsuo Handa wrote:
Hello.
It seems to me that "mount --move /tmp/old/ /tmp/new/" is not working on opensuse 12.3 kernel.
linux:~ # uname -r 3.7.10-1.1-desktop linux:~ # mkdir -p /tmp/old/ /tmp/new/ linux:~ # mount -t tmpfs none /tmp/old/ linux:~ # mount --move /tmp/old/ /tmp/new/ mount: wrong fs type, bad option, bad superblock on /tmp/old, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so
strace says
mount("/tmp/old", "/tmp/new", 0xb7c34168, MS_MGC_VAL|MS_MOVE, NULL) = -1 EINVAL (Invalid argument)
Is this a bug (or is this caused by yama-like restriction mechanism)?
Do you know the last kernel where this worked as you expect? I've tested vanilla kernels from 3.0 to 3.9-rc4 and it behaves as you describe in your test.
This seems to be yest another fallout of changed systemd policy - it now makes / shared mount. bor@opensuse:~> sudo mount --move /tmp/old /tmp/new mount: wrong fs type, bad option, bad superblock on /tmp/old, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so bor@opensuse:~> sudo mount --make-private / bor@opensuse:~> sudo mount --move /tmp/old /tmp/new bor@opensuse:~> cd
Andrey Borzenkov wrote:
This seems to be yest another fallout of changed systemd policy - it now makes / shared mount.
bor@opensuse:~> sudo mount --move /tmp/old /tmp/new mount: wrong fs type, bad option, bad superblock on /tmp/old, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so bor@opensuse:~> sudo mount --make-private / bor@opensuse:~> sudo mount --move /tmp/old /tmp/new bor@opensuse:~> cd
Is that another systemd change, really? Aren't fs's mounted on initrd before systemd is invoked? Is it something that systemd needed to have? I.e. if it is made private would systemd care? If not, why would it have been made shared? Maybe a default in mount for root changed? -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Mon, Apr 8, 2013 at 3:45 PM, Linda Walsh <suse@tlinx.org> wrote:
Is it something that systemd needed to have? I.e. if it is made private would systemd care? If not, why would it have been made shared?
Maybe a default in mount for root changed?
Having the default mount propagation be "shared" solves some situations where a configuration item (say, PrivateTmp=) requires spawning a service in a Linux kernel file system namespace. Other mounts that happen post-service start aren't visible to the service, despite being visible and functional to administrators. It's hard to debug, and it won't show any obvious warnings or errors in logs. I don't believe making root private breaks systemd itself. I think it just makes other administration potentially confusing. -- David Strauss | david@davidstrauss.net | +1 512 577 5827 [mobile] -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
Here is the commit with some background: http://cgit.freedesktop.org/systemd/systemd/commit/?id=b3ac5f8cb98757416d866... On Thu, Apr 11, 2013 at 11:42 PM, David Strauss <david@davidstrauss.net> wrote:
On Mon, Apr 8, 2013 at 3:45 PM, Linda Walsh <suse@tlinx.org> wrote:
Is it something that systemd needed to have? I.e. if it is made private would systemd care? If not, why would it have been made shared?
Maybe a default in mount for root changed?
Having the default mount propagation be "shared" solves some situations where a configuration item (say, PrivateTmp=) requires spawning a service in a Linux kernel file system namespace. Other mounts that happen post-service start aren't visible to the service, despite being visible and functional to administrators. It's hard to debug, and it won't show any obvious warnings or errors in logs.
I don't believe making root private breaks systemd itself. I think it just makes other administration potentially confusing.
-- David Strauss | david@davidstrauss.net | +1 512 577 5827 [mobile]
-- David Strauss | david@davidstrauss.net | +1 512 577 5827 [mobile] -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
Andrey Borzenkov wrote:
This seems to be yest another fallout of changed systemd policy - it now makes / shared mount.
bor@opensuse:~> sudo mount --move /tmp/old /tmp/new mount: wrong fs type, bad option, bad superblock on /tmp/old, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so bor@opensuse:~> sudo mount --make-private / bor@opensuse:~> sudo mount --move /tmp/old /tmp/new bor@opensuse:~> cd
OK. Changing mount flags solves this problem. Current way of mounting seems to be breaking not only "mount --move" but also "pivot_root". linux:~ # /usr/bin/newns /sbin/pivot_root /proc/ /proc/self/ Starting /sbin/pivot_root pivot_root: failed to change root from `/proc/' to `/proc/self/': Invalid argument linux:~ # mount --make-private / linux:~ # mount --make-private /proc/ linux:~ # /usr/bin/newns /sbin/pivot_root /proc/ /proc/self/ Starting /sbin/pivot_root linux:~ # -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
I posted this to another, related thread, but here's the relevant commit and reasoning: http://cgit.freedesktop.org/systemd/systemd/commit/?id=b3ac5f8cb98757416d866... On Tue, Apr 9, 2013 at 5:15 AM, Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:
Andrey Borzenkov wrote:
This seems to be yest another fallout of changed systemd policy - it now makes / shared mount.
bor@opensuse:~> sudo mount --move /tmp/old /tmp/new mount: wrong fs type, bad option, bad superblock on /tmp/old, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so bor@opensuse:~> sudo mount --make-private / bor@opensuse:~> sudo mount --move /tmp/old /tmp/new bor@opensuse:~> cd
OK. Changing mount flags solves this problem.
Current way of mounting seems to be breaking not only "mount --move" but also "pivot_root".
linux:~ # /usr/bin/newns /sbin/pivot_root /proc/ /proc/self/ Starting /sbin/pivot_root pivot_root: failed to change root from `/proc/' to `/proc/self/': Invalid argument linux:~ # mount --make-private / linux:~ # mount --make-private /proc/ linux:~ # /usr/bin/newns /sbin/pivot_root /proc/ /proc/self/ Starting /sbin/pivot_root linux:~ # _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- David Strauss | david@davidstrauss.net | +1 512 577 5827 [mobile] -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
El 08/04/13 09:49, Tetsuo Handa escribió:
Hello.
It seems to me that "mount --move /tmp/old/ /tmp/new/" is not working on opensuse 12.3 kernel.
linux:~ # uname -r 3.7.10-1.1-desktop linux:~ # mkdir -p /tmp/old/ /tmp/new/ linux:~ # mount -t tmpfs none /tmp/old/ linux:~ # mount --move /tmp/old/ /tmp/new/ mount: wrong fs type, bad option, bad superblock on /tmp/old, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so
strace says
mount("/tmp/old", "/tmp/new", 0xb7c34168, MS_MGC_VAL|MS_MOVE, NULL) = -1 EINVAL (Invalid argument)
Is this a bug (or is this caused by yama-like restriction mechanism)?
Regards.
http://karelzak.blogspot.com/2013/04/umount8-mount8-and-nsenter1.html might help. -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
participants (6)
-
Andrey Borzenkov
-
Cristian Rodríguez
-
David Strauss
-
Jeff Mahoney
-
Linda Walsh
-
Tetsuo Handa