Oleg Nesterov 1dd768c081 pids: sys_getsid: fix unsafe *pid usage, fix possible 0 instead of -ESRCH
1. sys_getsid() needs rcu_read_lock() to derive the session _nr, even if
   the task is current, otherwise we can race with another thread which
   does sys_setsid().

2. The task can exit between find_task_by_vpid() and task_session_vnr(),
   in that unlikely case sys_getsid() returns 0 instead of -ESRCH.

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>
2008-04-30 08:29:49 -07:00
..
2008-04-30 08:29:37 -07:00
2008-04-28 08:58:23 -07:00
2008-04-30 08:29:48 -07:00
2008-04-29 08:05:59 -07:00
2008-04-30 08:29:48 -07:00
2008-04-30 08:29:47 -07:00
2008-04-30 08:29:38 -07:00
2008-04-30 08:29:37 -07:00
2008-04-30 08:29:48 -07:00