linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Pavel Machek <pavel@ucw.cz>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Theodore Ts'o <tytso@mit.edu>,
	David Herrmann <dh.herrmann@gmail.com>
Subject: Re: [RFC 2/2] fs,proc: Respect FMODE_WRITE when opening /proc/pid/fd/N
Date: Mon, 21 Apr 2014 17:30:58 +0100	[thread overview]
Message-ID: <20140421163058.GS18016@ZenIV.linux.org.uk> (raw)
In-Reply-To: <430cfc67aae9b9ad5eab4d293107285ad44c5fd9.1398097304.git.luto@amacapital.net>

On Mon, Apr 21, 2014 at 09:22:48AM -0700, Andy Lutomirski wrote:

> +static int proc_may_follow(struct nameidata *nd, struct file *f)
> +{
> +	if (!nd)
> +		return 0;  /* This is readlink, */
> +
> +	if ((nd->flags & LOOKUP_WRITE) && !(f->f_mode & FMODE_WRITE))
> +		return -EACCES;
> +
> +	return 0;
> +}

And this is just plain wrong.  WTF are you making the traversal of symlink
in the middle of pathname dependent on the open flags?

NAK.

  reply	other threads:[~2014-04-21 16:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-21 16:22 [RFC 0/2] Fix permission checks on open("/proc/self/fd/N", O_RDWR) Andy Lutomirski
2014-04-21 16:22 ` [RFC 1/2] fs,proc: Pass nameidata to proc_get_link implementations Andy Lutomirski
2014-04-21 16:29   ` Al Viro
2014-04-21 16:22 ` [RFC 2/2] fs,proc: Respect FMODE_WRITE when opening /proc/pid/fd/N Andy Lutomirski
2014-04-21 16:30   ` Al Viro [this message]
2014-04-21 17:00     ` Andy Lutomirski
2014-04-21 17:04       ` Andy Lutomirski
2014-04-21 17:48         ` Andy Lutomirski
2014-04-22 12:44   ` David Herrmann
2014-04-22 13:49     ` Andy Lutomirski
2014-04-22 14:17       ` David Herrmann
2014-04-22 14:33         ` Andy Lutomirski
2014-04-22 15:03           ` David Herrmann
2014-04-22 15:20             ` Andy Lutomirski
2014-04-22 14:40         ` Pavel Machek
2014-04-22 14:31     ` Pavel Machek
2014-04-22 15:19       ` David Herrmann
2014-04-22 15:24         ` Andy Lutomirski
2014-04-22 16:44           ` David Herrmann
2014-04-22 17:05             ` Andy Lutomirski
2014-04-22 18:58         ` Pavel Machek
2014-04-22 21:31           ` David Herrmann
2014-04-22 21:34             ` Andy Lutomirski
2014-04-22 22:12             ` Pavel Machek

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=20140421163058.GS18016@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=dh.herrmann@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=pavel@ucw.cz \
    --cc=tytso@mit.edu \
    /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).