mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aleksa Sarai <cyphar@cyphar.com>
To: Ross Zwisler <zwisler@google.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	Ross Zwisler <zwisler@chromium.org>,
	linux-kernel@vger.kernel.org,
	Mattias Nissler <mnissler@chromium.org>,
	Benjamin Gordon <bmgordon@google.com>,
	Raul Rangel <rrangel@google.com>,
	Micah Morton <mortonm@google.com>,
	Dmitry Torokhov <dtor@google.com>, Jan Kara <jack@suse.cz>,
	David Howells <dhowells@redhat.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v4] Add a "nosymfollow" mount option.
Date: Sun, 9 Feb 2020 20:12:36 +1100	[thread overview]
Message-ID: <20200209091236.bmozkgo6jvfiakei@yavin> (raw)
In-Reply-To: <20200203221556.GA210383@google.com>

[-- Attachment #1: Type: text/plain, Size: 2412 bytes --]

On 2020-02-03, Ross Zwisler <zwisler@google.com> wrote:
> On Sat, Feb 01, 2020 at 05:27:44PM +1100, Aleksa Sarai wrote:
> > On 2020-01-31, Ross Zwisler <zwisler@google.com> wrote:
> > > On Fri, Jan 31, 2020 at 12:51:34PM +1100, Aleksa Sarai wrote:
> > > If noxdev would involve a pathname traversal to make sure you don't ever leave
> > > mounts with noxdev set, I think this could potentially cover the use cases I'm
> > > worried about.  This would restrict symlink traversal to files within the same
> > > filesystem, and would restrict traversal to both normal and bind mounts from
> > > within the restricted filesystem, correct?
> > 
> > Yes, but it would have to block all mountpoint crossings including
> > bind-mounts, because the obvious way of checking for mountpoint
> > crossings (vfsmount comparisons) results in bind-mounts being seen as
> > different mounts. This is how LOOKUP_NO_XDEV works. Would this be a
> > show-stopped for ChromeOS?
> >
> > I personally find "noxdev" to be a semantically clearer statement of
> > intention ("I don't want any lookup that reaches this mount-point to
> > leave") than "nosymfollow" (though to be fair, this is closer in
> > semantics to the other "no*" mount flags). But after looking at [1] and
> > thinking about it for a bit, I don't really have a problem with either
> > solution.
> 
> For ChromeOS we want to protect data both on user-provided filesystems (i.e.
> USB attached drives and the like) as well as on our "stateful" partition.  
> 
> The noxdev mount option would resolve our concerns for user-provided
> filesystems, but I don't think that we would be able to use it for stateful
> because symlinks on stateful that point elsewhere within stable are still a
> security risk.  There is more explanation on why this is the case in [1].
> Thank you for linking to that, by the way.
> 
> I think our security concerns around both use cases, user-provided filesystems
> and the stateful partition, can be resolved in ChromeOS with the nosymfollow
> mount flag.  Based on that, my current preference is for the 'nosymfollow'
> mount flag.

Fair enough. I can work on and send "noxdev" separately -- I only
brought it up because the attack scenarios (and connection to openat2)
are both fairly similar.

-- 
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2020-02-09  9:13 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
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 [this message]
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=20200209091236.bmozkgo6jvfiakei@yavin \
    --to=cyphar@cyphar.com \
    --cc=bmgordon@google.com \
    --cc=dhowells@redhat.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=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 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®