Skip to content

Commit

Permalink
sys_getppid: add missing rcu_dereference
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Mandeep Singh Baines authored and torvalds committed Dec 9, 2011
1 parent 1cee22b commit 031af16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 031af16

Please sign in to comment.