wait_task_continued/zombie: don't use task_pid_nr_ns() lockless
authorOleg Nesterov <oleg@tv-sign.ru>
Fri, 8 Feb 2008 12:19:07 +0000 (04:19 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 8 Feb 2008 17:22:26 +0000 (09:22 -0800)
commit3a515e4a62dbf7e4c213740268a5267faa69e5b2
tree51f98e662c80ca5de628f09c5eb24d18f1794f6c
parentf2cc3eb133baa2e9dc8efd40f417106b2ee520f3
wait_task_continued/zombie: don't use task_pid_nr_ns() lockless

Surprise, the other two wait_task_*() functions also abuse the
task_pid_nr_ns() function, and may cause read-after-free or report nr == 0
in wait_task_continued().  wait_task_zombie() doesn't have this problem,
but it is still better to cache pid_t rather than call task_pid_nr_ns()
three times on the saved pid_namespace.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/exit.c