* Does MNT_LOCKED work as expected?
@ 2014-09-29 9:10 Andrey Wagin
2014-09-29 23:32 ` Eric W. Biederman
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Wagin @ 2014-09-29 9:10 UTC (permalink / raw)
To: LKML, Eric W. Biederman, Serge Hallyn, linux-fsdevel, Alexander Viro
Hi All,
I think I found a case, when MNT_LOCKED (5ff9d8a65ce8 "vfs: Lock in
place mounts from more privileged users") doesn't help to hide
overmounted parts from unprivileged users.
The problem exists for mounts, which are not overmounted entirely. In
such cases we can open a directory from a target mount, which is not
overmounted. Then we do pivot_root to move all mounts in a temporary
directory. At the final step we deatch all mounts from the temporary
directory. After that all children mounts are umounted from the target
mount and we can use our file descriptor to open files, which have
been overmount before.
Here is a example https://github.com/avagin/userns_vs_mntns.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Does MNT_LOCKED work as expected?
2014-09-29 9:10 Does MNT_LOCKED work as expected? Andrey Wagin
@ 2014-09-29 23:32 ` Eric W. Biederman
0 siblings, 0 replies; 2+ messages in thread
From: Eric W. Biederman @ 2014-09-29 23:32 UTC (permalink / raw)
To: Andrey Wagin; +Cc: LKML, Serge Hallyn, linux-fsdevel, Alexander Viro
Andrey Wagin <avagin@gmail.com> writes:
> Hi All,
>
> I think I found a case, when MNT_LOCKED (5ff9d8a65ce8 "vfs: Lock in
> place mounts from more privileged users") doesn't help to hide
> overmounted parts from unprivileged users.
> The problem exists for mounts, which are not overmounted entirely. In
> such cases we can open a directory from a target mount, which is not
> overmounted. Then we do pivot_root to move all mounts in a temporary
> directory. At the final step we deatch all mounts from the temporary
> directory. After that all children mounts are umounted from the target
> mount and we can use our file descriptor to open files, which have
> been overmount before.
>
> Here is a example https://github.com/avagin/userns_vs_mntns.
I am looking at this now to make certain I am understand what you are
seeing but so far it looks like lazy unmounts allow you to bypass
MNT_LOCKED :(
Grumble.
Eric
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-29 23:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-29 9:10 Does MNT_LOCKED work as expected? Andrey Wagin
2014-09-29 23:32 ` Eric W. Biederman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®