aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/proc_fs.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2008-02-08 04:18:31 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 09:22:23 -0800
commitee992744ea53db0a90c986fd0a70fbbf91e7f8bd (patch)
tree2d15727e92c407bb22c4842923cbfb2dfda82306 /include/linux/proc_fs.h
parentproc: implement proc_single_file_operations (diff)
downloadlinux-dev-ee992744ea53db0a90c986fd0a70fbbf91e7f8bd.tar.xz
linux-dev-ee992744ea53db0a90c986fd0a70fbbf91e7f8bd.zip
proc: rewrite do_task_stat to correctly handle pid namespaces.
Currently (as pointed out by Oleg) do_task_stat has a race when calling task_pid_nr_ns with the task exiting. In addition do_task_stat is not currently displaying information in the context of the pid namespace that mounted the /proc filesystem. So "cut -d' ' -f 1 /proc/<pid>/stat" may not equal <pid>. This patch fixes the problem by converting to a single_open seq_file show method. Getting the pid namespace from the filesystem superblock instead of current, and simply using the the struct pid from the inode instead of attempting to get that same pid from the task. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/proc_fs.h')
0 files changed, 0 insertions, 0 deletions