Commit 031af165 authored by Mandeep Singh Baines's avatar Mandeep Singh Baines Committed by Linus Torvalds

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: default avatarMandeep 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1cee22b7
...@@ -1368,7 +1368,7 @@ SYSCALL_DEFINE0(getppid) ...@@ -1368,7 +1368,7 @@ SYSCALL_DEFINE0(getppid)
int pid; int pid;
rcu_read_lock(); rcu_read_lock();
pid = task_tgid_vnr(current->real_parent); pid = task_tgid_vnr(rcu_dereference(current->real_parent));
rcu_read_unlock(); rcu_read_unlock();
return pid; return pid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment