summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMandeep Singh Baines <msb@chromium.org>2011-12-08 14:34:44 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-09 07:50:29 -0800
commit031af165b1cd295ef04d2bfbcae9bc3cb9180735 (patch)
treefc5abaa84eb1135cae41e8ab0d3356171fc0a760
parent1cee22b7f385b6c4f716846203a96e1f302132aa (diff)
downloadlinux-031af165b1cd295ef04d2bfbcae9bc3cb9180735.tar.bz2
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 <msb@chromium.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/timer.c2
1 files changed, 1 insertions, 1 deletions
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;