• E
    pid: Extend/Fix pid_vnr · 44c4e1b2
    Eric W. Biederman 提交于
    pid_vnr returns the user space pid with respect to the pid namespace the
    struct pid was allocated in.  What we want before we return a pid to user
    space is the user space pid with respect to the pid namespace of current.
    
    pid_vnr is a very nice optimization but because it isn't quite what we want
    it is easy to use pid_vnr at times when we aren't certain the struct pid
    was allocated in our pid namespace.
    
    Currently this describes at least tiocgpgrp and tiocgsid in ttyio.c the
    parent process reported in the core dumps and the parent process in
    get_signal_to_deliver.
    
    So unless the performance impact is huge having an interface that does what
    we want instead of always what we want should be much more reliable and
    much less error prone.
    Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
    Cc: Oleg Nesterov <oleg@tv-sign.ru>
    Acked-by: NPavel Emelyanov <xemul@openvz.org>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    44c4e1b2
pid.c 12.8 KB