lkml.org 
[lkml]   [2015]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: question about commit "proc: make proc_fd_permission() thread-friendly"
    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.



    \
     
     \ /
      Last update: 2015-11-02 19:21    [W:2.931 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site