All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ross Zwisler <zwisler@chromium.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Mattias Nissler <mnissler@chromium.org>,
	Aleksa Sarai <cyphar@cyphar.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Benjamin Gordon <bmgordon@google.com>,
	David Howells <dhowells@redhat.com>,
	Dmitry Torokhov <dtor@google.com>,
	Jesse Barnes <jsbarnes@google.com>,
	linux-fsdevel@vger.kernel.org, Micah Morton <mortonm@google.com>,
	Raul Rangel <rrangel@google.com>
Subject: Re: [PATCH v7] Add a "nosymfollow" mount option.
Date: Wed, 12 Aug 2020 13:53:12 -0600	[thread overview]
Message-ID: <CAGRrVHwCYRXixfft1FCnwU-1UzuoUF3iVayRjD8G_QXX2+nOcQ@mail.gmail.com> (raw)
In-Reply-To: <20200812183557.GB17456@casper.infradead.org>

On Wed, Aug 12, 2020 at 12:36 PM Matthew Wilcox <willy@infradead.org> wrote:
> On Tue, Aug 11, 2020 at 04:28:03PM -0600, Ross Zwisler wrote:
> > diff --git a/include/uapi/linux/mount.h b/include/uapi/linux/mount.h
> > index 96a0240f23fed..dd8306ea336c1 100644
> > --- a/include/uapi/linux/mount.h
> > +++ b/include/uapi/linux/mount.h
> > @@ -16,6 +16,7 @@
> >  #define MS_REMOUNT   32      /* Alter flags of a mounted FS */
> >  #define MS_MANDLOCK  64      /* Allow mandatory locks on an FS */
> >  #define MS_DIRSYNC   128     /* Directory modifications are synchronous */
> > +#define MS_NOSYMFOLLOW       256     /* Do not follow symlinks */
> >  #define MS_NOATIME   1024    /* Do not update access times. */
> >  #define MS_NODIRATIME        2048    /* Do not update directory access times */
> >  #define MS_BIND              4096
>
> Does this need to be added to MS_RMT_MASK too?

I don't think so, because IIUC that is only for "superblock flags",
i.e. flags which are part of the sb_flags definition in
do_mount()/path_mount()?

https://github.com/torvalds/linux/blob/master/fs/namespace.c#L3172

With the current code I'm able to remount and flip nosymfollow both
directions without issue.  Similarly, MS_NOEXEC can be turned on and
off at will, and it's not part of MS_RMT_MASK nor sb_flags.

Interestingly, though, if you change MS_RMT_MASK to be 0, I would
expect us to be unable to twiddle all the flags which are currently
part of it, but that isn't the case.   I was still able to change
between RO/RW, and turn on lazytime.

So, I think this flag is working as expected, but that there is
probably a bug in there somewhere WRT the handling of MS_RMT_MASK.

      reply	other threads:[~2020-08-12 19:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 22:28 [PATCH v7] Add a "nosymfollow" mount option Ross Zwisler
2020-08-12  1:43 ` Aleksa Sarai
2020-08-12 17:59   ` Ross Zwisler
2020-08-12 18:35 ` Matthew Wilcox
2020-08-12 19:53   ` Ross Zwisler [this message]

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=CAGRrVHwCYRXixfft1FCnwU-1UzuoUF3iVayRjD8G_QXX2+nOcQ@mail.gmail.com \
    --to=zwisler@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=bmgordon@google.com \
    --cc=cyphar@cyphar.com \
    --cc=dhowells@redhat.com \
    --cc=dtor@google.com \
    --cc=jsbarnes@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mnissler@chromium.org \
    --cc=mortonm@google.com \
    --cc=rrangel@google.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.