linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Christoph Hellwig <hch@infradead.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Eugene Teo <eugene@redhat.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Bodo Eggert <7eggert@web.de>
Subject: Re: [PATCH v2] vfs: add NOFOLLOW flag to umount(2)
Date: Sun, 21 Feb 2010 02:01:44 +0000	[thread overview]
Message-ID: <20100221020144.GV30031@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20100211172100.GA28533@infradead.org>

On Thu, Feb 11, 2010 at 12:21:00PM -0500, Christoph Hellwig wrote:
> On Wed, Feb 10, 2010 at 12:15:53PM +0100, Miklos Szeredi wrote:
> >  - renamed flag to UMOUNT_NOFOLLOW
> >  - added UMOUNT_UNUSED for feature detection
> 
> Umm, why?  MNT_ certainly isn't the best naming for unmount flags,
> but switching convention after we had a few doesn't make any sense.

Actually, I've got more interesting question: what's being attempted
there?  Is that just a "let's protect ourselves against somebody feeding
us an untrusted symlink"?  I'm not sure if it makes much sense; if we
are dealing with pathnames on untrusted fs, there's nothing to stop the
attacker from having /mnt/foo/dir (originally containing a mountpoint
at /mnt/foo/dir/usr) killed and replaced with a symlink to /, making any
code that does umount() on such pathnames vulnerable as hell anyway.

Lack of LOOKUP_FOLLOW affects only the last pathname component.  So what
is that patch trying to make safe?

  parent reply	other threads:[~2010-02-21  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10 11:15 [PATCH v2] vfs: add NOFOLLOW flag to umount(2) Miklos Szeredi
2010-02-11 17:21 ` Christoph Hellwig
2010-02-11 18:06   ` Miklos Szeredi
2010-02-21  2:01   ` Al Viro [this message]
2010-02-22 20:29     ` Miklos Szeredi

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=20100221020144.GV30031@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=7eggert@web.de \
    --cc=eugene@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mtk.manpages@gmail.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).