From: Mandeep Singh Baines Date: Thu, 8 Dec 2011 22:34:44 +0000 (-0800) Subject: sys_getppid: add missing rcu_dereference X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=031af165b1cd295ef04d2bfbcae9bc3cb9180735;p=openwrt%2Fstaging%2Fblogic.git sys_getppid: add missing rcu_dereference In order to safely dereference current->real_parent inside an rcu_read_lock, we need an rcu_dereference. Signed-off-by: Mandeep Singh Baines Cc: Thomas Gleixner Cc: Pavel Emelyanov Cc: Oleg Nesterov Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/timer.c b/kernel/timer.c index dbaa62422b13..9c3c62b0c4bc 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1368,7 +1368,7 @@ SYSCALL_DEFINE0(getppid) int pid; rcu_read_lock(); - pid = task_tgid_vnr(current->real_parent); + pid = task_tgid_vnr(rcu_dereference(current->real_parent)); rcu_read_unlock(); return pid;