From: Oleg Nesterov Date: Wed, 30 Apr 2008 07:54:28 +0000 (-0700) Subject: pids: sys_getsid: fix unsafe *pid usage, fix possible 0 instead of -ESRCH X-Git-Tag: v2.6.26-rc1~163 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dd768c0815334d2319d6377f0750ace075b6142;p=pandora-kernel.git 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 Cc: Roland McGrath Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed