aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMandeep Singh Baines <[email protected]>2011-12-08 14:34:44 -0800
committerLinus Torvalds <[email protected]>2011-12-09 07:50:29 -0800
commit031af165b1cd295ef04d2bfbcae9bc3cb9180735 (patch)
treefc5abaa84eb1135cae41e8ab0d3356171fc0a760
parent1cee22b7f385b6c4f716846203a96e1f302132aa (diff)
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 <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Kees Cook <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-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;