All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Ross Zwisler <zwisler@chromium.org>
Cc: 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, linux-kselftest@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>,
	Micah Morton <mortonm@google.com>,
	Raul Rangel <rrangel@google.com>, Shuah Khan <shuah@kernel.org>,
	Ross Zwisler <zwisler@google.com>
Subject: Re: [PATCH v9 1/2] Add a "nosymfollow" mount option.
Date: Thu, 27 Aug 2020 21:10:15 +0100	[thread overview]
Message-ID: <20200827201015.GC1236603@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20200827200801.GB1236603@ZenIV.linux.org.uk>

On Thu, Aug 27, 2020 at 09:08:01PM +0100, Al Viro wrote:
> On Thu, Aug 27, 2020 at 11:09:46AM -0600, Ross Zwisler wrote:
> > From: Mattias Nissler <mnissler@chromium.org>
> > 
> > For mounts that have the new "nosymfollow" option, don't follow symlinks
> > when resolving paths. The new option is similar in spirit to the
> > existing "nodev", "noexec", and "nosuid" options, as well as to the
> > LOOKUP_NO_SYMLINKS resolve flag in the openat2(2) syscall. Various BSD
> > variants have been supporting the "nosymfollow" mount option for a long
> > time with equivalent implementations.
> > 
> > Note that symlinks may still be created on file systems mounted with
> > the "nosymfollow" option present. readlink() remains functional, so
> > user space code that is aware of symlinks can still choose to follow
> > them explicitly.
> > 
> > Setting the "nosymfollow" mount option helps prevent privileged
> > writers from modifying files unintentionally in case there is an
> > unexpected link along the accessed path. The "nosymfollow" option is
> > thus useful as a defensive measure for systems that need to deal with
> > untrusted file systems in privileged contexts.
> > 
> > More information on the history and motivation for this patch can be
> > found here:
> > 
> > https://sites.google.com/a/chromium.org/dev/chromium-os/chromiumos-design-docs/hardening-against-malicious-stateful-data#TOC-Restricting-symlink-traversal
> > 
> > Signed-off-by: Mattias Nissler <mnissler@chromium.org>
> > Signed-off-by: Ross Zwisler <zwisler@google.com>
> > Reviewed-by: Aleksa Sarai <cyphar@cyphar.com>
> > ---
> > Changes since v8 [1]:
> >  * Look for MNT_NOSYMFOLLOW in link->mnt->mnt_flags so we are testing
> >    the link itself rather than the directory holding the link. (Al Viro)
> >  * Rebased onto v5.9-rc2.
> 
> AFAICS, it applies clean to -rc1; what was the rebase about?

Applied (to -rc1) and pushed

  reply	other threads:[~2020-08-27 20:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 17:09 [PATCH v9 1/2] Add a "nosymfollow" mount option Ross Zwisler
2020-08-27 17:09 ` [PATCH v9 2/2] selftests: mount: add nosymfollow tests Ross Zwisler
2020-08-27 20:08 ` [PATCH v9 1/2] Add a "nosymfollow" mount option Al Viro
2020-08-27 20:10   ` Al Viro [this message]
2020-08-27 20:25     ` Ross Zwisler
2020-09-09 15:50       ` Ross Zwisler

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=20200827201015.GC1236603@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --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=linux-kselftest@vger.kernel.org \
    --cc=mnissler@chromium.org \
    --cc=mortonm@google.com \
    --cc=rrangel@google.com \
    --cc=shuah@kernel.org \
    --cc=willy@infradead.org \
    --cc=zwisler@chromium.org \
    --cc=zwisler@google.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 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.