mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Ross Zwisler <zwisler@chromium.org>
Cc: linux-kernel@vger.kernel.org,
	Mattias Nissler <mnissler@chromium.org>,
	Benjamin Gordon <bmgordon@google.com>,
	Ross Zwisler <zwisler@google.com>,
	Raul Rangel <rrangel@google.com>,
	Micah Morton <mortonm@google.com>,
	Dmitry Torokhov <dtor@google.com>, Jan Kara <jack@suse.cz>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v4] Add a "nosymfollow" mount option.
Date: Thu, 30 Jan 2020 16:45:58 -0800	[thread overview]
Message-ID: <20200131004558.GA6699@bombadil.infradead.org> (raw)
In-Reply-To: <20200131002750.257358-1-zwisler@google.com>

On Thu, Jan 30, 2020 at 05:27:50PM -0700, Ross Zwisler wrote:
> 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. 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.

The openat2 series was just merged yesterday which includes a
LOOKUP_NO_SYMLINKS option.  Is this enough for your needs, or do you
need the mount option?

https://lore.kernel.org/linux-fsdevel/20200129142709.GX23230@ZenIV.linux.org.uk/

  reply	other threads:[~2020-01-31  0:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31  0:27 Ross Zwisler
2020-01-31  0:45 ` Matthew Wilcox [this message]
2020-01-31  1:51   ` Aleksa Sarai
2020-01-31 21:20     ` Ross Zwisler
2020-02-01  6:27       ` Aleksa Sarai
2020-02-03 22:15         ` Ross Zwisler
2020-02-09  9:12           ` Aleksa Sarai
2020-01-31 19:55   ` 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=20200131004558.GA6699@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=bmgordon@google.com \
    --cc=dtor@google.com \
    --cc=jack@suse.cz \
    --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=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 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®