All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: "Jin, Yihua" <yihua.jin@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: question about commit "proc: make proc_fd_permission() thread-friendly"
Date: Mon, 2 Nov 2015 19:46:28 +0100	[thread overview]
Message-ID: <20151102184628.GA4909@redhat.com> (raw)
In-Reply-To: <B4C772D477996F45A8F9B1CF31AE3AF3119C4F46@SHSMSX104.ccr.corp.intel.com>

Hi Jin,

(add lkml)

On 11/02, Jin, Yihua wrote:
>
> --- a/fs/proc/fd.c<http://kernel.suse.com/cgit/kernel/tree/fs/proc/fd.c?h=SLE12&id=a3c039929d01f793c47922017b6c0ae438e11598>
> +++ b/fs/proc/fd.c<http://kernel.suse.com/cgit/kernel/tree/fs/proc/fd.c?h=SLE12&id=96d0df79f2644fc823f26c06491e182d87a90c2a>
> @@ -286,7 +286,7 @@ int proc_fd_permission(struct inode *inode, int mask)
> int rv = generic_permission(inode, mask);
> if (rv == 0)
> return 0;
> - if (task_pid(current) == proc_pid(inode))
> + if (task_tgid(current) == proc_pid(inode))
> rv = 0;
> return rv;
> }
>
> I understand the intention is to make sub-thread access /proc/self/fd/ OK, however, after this commit, access /proc/<tid>/fd/ is denied if the process is non-dumpable.
>
> This make application in a delimma:
> Before your commit, application sub-thread can access /proc/<tid>/fd/, but not /proc/self/fd/, after your commit, application sub-thread can access /proc/self/fd/, but not /proc/<tid>/fd/.
> This make application impossible to adapt both to kernel before the commit and kernel after the commit.

Yes thanks... I'll try to think tomorrow.

Oleg.


           reply	other threads:[~2015-11-02 17:50 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <B4C772D477996F45A8F9B1CF31AE3AF3119C4F46@SHSMSX104.ccr.corp.intel.com>]

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=20151102184628.GA4909@redhat.com \
    --to=oleg@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yihua.jin@intel.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 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.