From: Andrey Wagin <avagin@gmail.com>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Cyrill Gorcunov <gorcunov@openvz.org>,
Pavel Emelyanov <xemul@parallels.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] fs: show locked and lock_ro options in mountinfo
Date: Sat, 28 Mar 2015 01:35:32 +0300 [thread overview]
Message-ID: <CANaxB-xbG80-YbRqypYVXbnOMxBPfYep4y0suNOH7tGYs2ao2A@mail.gmail.com> (raw)
In-Reply-To: <CAFLxGvxaJdRV7c9jRhjQibyk+55GWSKyn+vuWbgXuvNSsPdQ5w@mail.gmail.com>
2015-03-28 0:42 GMT+03:00 Richard Weinberger <richard.weinberger@gmail.com>:
> On Fri, Mar 27, 2015 at 9:39 PM, Andrey Vagin <avagin@openvz.org> wrote:
>> I don't see any reasons to hide them. This information can help to
>> understand errors.
>
> Because these flags are set/read only internally by the VFS. In contrast
> to the other flags shown by mountinfo MNT_LOCKED is not a mount option.
But this flag is set as a result of the specified user action, when he
unshares userns and mntns. This flag affects visiable behaviour.
>
> Why does it help to debug errors?
> How would a user know that mount() with MS_BIND returns EINVAL because
> the mount source is MNT_LOCKED? This information is useless for her.
If I see lock_ro, I can be sure that mount -o remount,bind,rw /XXX will fail.
If I see locked, I know that this mount can't be umounted or moved
and can be bind-mounted only recursively.
If a user see these flags, he can check that a mount namespace is
configured correctly without security issues.
Sorry but I don't understand why you think that this information is
useless for users.
> If you argue like that you'd have to expose the whole VFS state to userland.
I have not noticed other MNT_LOCK_* flags. I should think more about
what information are a really required for dumping mount namespaces.
>
>> And this information is required for correct checkpoint/restore of mount
>> namespaces.
>
> Why especially MNT_LOCKED and not all the other flags used by VFS?
My goal is to dump enough information about a mount namespace to be
able to restore it back later. I don't know how to do this without
knowledge about locked mounts. I will think.
> Say MNT_DOOMED?
Mounts with MNT_DOOMED are never shown in mountinfo, are they?
Thank you for looking at this patch.
>
> --
> Thanks,
> //richard
next prev parent reply other threads:[~2015-03-27 22:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 20:39 [PATCH] fs: show locked and lock_ro options in mountinfo Andrey Vagin
2015-03-27 21:42 ` Richard Weinberger
2015-03-27 22:35 ` Andrey Wagin [this message]
2015-03-27 22:47 ` Richard Weinberger
2015-03-31 15:15 ` Andrey Wagin
2015-03-31 21:29 ` Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CANaxB-xbG80-YbRqypYVXbnOMxBPfYep4y0suNOH7tGYs2ao2A@mail.gmail.com \
--to=avagin@gmail.com \
--cc=ebiederm@xmission.com \
--cc=gorcunov@openvz.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard.weinberger@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=xemul@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).