From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754366AbbKBRuP (ORCPT ); Mon, 2 Nov 2015 12:50:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46967 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752603AbbKBRuM (ORCPT ); Mon, 2 Nov 2015 12:50:12 -0500 Date: Mon, 2 Nov 2015 19:46:28 +0100 From: Oleg Nesterov To: "Jin, Yihua" Cc: linux-kernel@vger.kernel.org Subject: Re: question about commit "proc: make proc_fd_permission() thread-friendly" Message-ID: <20151102184628.GA4909@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jin, (add lkml) On 11/02, Jin, Yihua wrote: > > --- a/fs/proc/fd.c > +++ b/fs/proc/fd.c > @@ -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//fd/ is denied if the process is non-dumpable. > > This make application in a delimma: > Before your commit, application sub-thread can access /proc//fd/, but not /proc/self/fd/, after your commit, application sub-thread can access /proc/self/fd/, but not /proc//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.