From: Andrew Morton Cc: Alexey Dobriyan Cc: "Eric W. Biederman" Cc: James Morris Cc: Chris Wright Cc: Ulrich Drepper Cc: Oleg Nesterov Cc: Kirill Korotaev Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton --- fs/proc/base.c | 4 ++++ 1 file changed, 4 insertions(+) diff -puN fs/proc/base.c~allow-access-to-proc-pid-fd-after-setuid-fix fs/proc/base.c --- a/fs/proc/base.c~allow-access-to-proc-pid-fd-after-setuid-fix +++ a/fs/proc/base.c @@ -1447,6 +1447,10 @@ static const struct file_operations proc .readdir = proc_readfd, }; +/* + * /proc/pid/fd needs a special permission handler so that a process can still + * access /proc/self/fd after it has executed a setuid(). + */ static int proc_fd_permission(struct inode *inode, int mask, struct nameidata *nd) { _