All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: /proc/pid/fd/ shows strange mode when executed via sudo.
Date: Fri, 18 May 2012 13:55:09 -0600	[thread overview]
Message-ID: <87ehqh2rj6.fsf@xmission.com> (raw)
In-Reply-To: <CA+55aFzc-K0OnXB4xJZ_ToZ+ZjNfy1zWgkRXx98W-t+h=w=GaQ@mail.gmail.com> (Linus Torvalds's message of "Fri, 18 May 2012 09:25:50 -0700")

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Fri, May 18, 2012 at 9:08 AM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> I would suggest just moving the i_mode initialization from
>> proc_fd_instantiate() into the revalidate function that we already
>> have, and that already fixes up i_uid/i_gid etc. Attached is a TOTALLY
>> UNTESTED patch that does this, and actually seems to simplify things
>> in the process.
>
> Ok, so it's now "tested" in the sense that it works for me, and fixes
> both my and your test-cases.
>
> Which doesn't mean that it is bug-free of course, but it does seem to
> be a sane patch that actually cleans things up.
>
> I'll delay committing it in case somebody hollers, but I think I'll
> mark it for stable too since this issue seems age-old, and the fix
> looks good.
>
> Ack/nak? Can anybody find anything wrong in that patch?

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

It looks reasonable.

I am a tad leery of the d_add without setting inode->i_mode
but the dcache lookup will have to call revalidate before
we access the inode so I don't expect a problem there.

Eric

  reply	other threads:[~2012-05-18 19:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02 13:40 /proc/pid/fd/ shows strange mode when executed via sudo Tetsuo Handa
2012-05-03 15:42 ` Serge Hallyn
2012-05-03 16:25   ` Tetsuo Handa
2012-05-18  2:39     ` Tetsuo Handa
2012-05-18  9:27       ` Tetsuo Handa
2012-05-18 16:08         ` Linus Torvalds
2012-05-18 16:25           ` Linus Torvalds
2012-05-18 19:55             ` Eric W. Biederman [this message]
2012-05-18 18:08           ` Al Viro
2012-05-18 18:18             ` Linus Torvalds
2012-05-18 18:23               ` Linus Torvalds
2012-05-18 18:45                 ` Al Viro
2012-05-18 18:55                   ` Linus Torvalds
2012-05-18 19:10                     ` Al Viro
2012-05-18 20:49                       ` Linus Torvalds
2012-05-18 21:23                         ` Al Viro
2012-05-18 21:26                           ` Linus Torvalds
2012-05-18 21:32                             ` Linus Torvalds
2012-05-18 22:29                               ` Al Viro
2012-05-19  7:08                                 ` Tetsuo Handa

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=87ehqh2rj6.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.