From: Oleg Nesterov Date: Mon, 2 Oct 2006 09:18:59 +0000 (-0700) Subject: [PATCH] introduce get_task_pid() to fix unsafe get_pid() X-Git-Tag: v2.6.19-rc1~379 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a657f78dcc8ea7c53eaa1f2a45ea2315738c15f;p=pandora-kernel.git [PATCH] introduce get_task_pid() to fix unsafe get_pid() proc_pid_make_inode: ei->pid = get_pid(task_pid(task)); I think this is not safe. get_pid() can be preempted after checking "pid != NULL". Then the task exits, does detach_pid(), and RCU frees the pid. Signed-off-by: Oleg Nesterov Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed