]> git.baikalelectronics.ru Git - kernel.git/commit
proc: proper pidns handling for /proc/self
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 8 Feb 2008 12:18:34 +0000 (04:18 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 8 Feb 2008 17:22:24 +0000 (09:22 -0800)
commitcc42b4f261ef4d0eb776b874c1b93dde08881df9
tree0b0df343406ff47578280e01388fc997064c8aa9
parentaceff78541bfb28e11dde9ca8ea847c6731b07af
proc: proper pidns handling for /proc/self

Currently if you access a /proc that is not mounted with your processes
current pid namespace /proc/self will point at a completely random task.

This patch fixes /proc/self to point to the current process if it is
available in the particular mount of /proc or to return -ENOENT if the
current process is not visible.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/base.c