From: Oleg Nesterov Date: Wed, 30 Apr 2008 07:54:29 +0000 (-0700) Subject: pids: sys_getpgid: fix unsafe *pid usage, s/tasklist/rcu/ X-Git-Tag: v2.6.26-rc1~162 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12a3de0a965826096d8adc593bcf4392a7d5b459;p=pandora-kernel.git pids: sys_getpgid: fix unsafe *pid usage, s/tasklist/rcu/ 1. sys_getpgid() needs rcu_read_lock() to derive the pgrp _nr, even if the task is current, otherwise we can race with another thread which does sys_setpgid(). 2. Use rcu_read_lock() instead of tasklist_lock when pid != 0, make sure that we don't use the NULL pid if the task exits right after successful find_task_by_vpid(). Signed-off-by: Oleg Nesterov Cc: Roland McGrath Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed