]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sys_getppid: add missing rcu_dereference
authorMandeep Singh Baines <msb@chromium.org>
Thu, 8 Dec 2011 04:32:06 +0000 (15:32 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 9 Dec 2011 04:52:21 +0000 (15:52 +1100)
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>
kernel/timer.c

index 5fc5a766ba1d3910f0bc0536c026c3512f078bac..a297ffcf888eb20093b0609485e03edbd85cd214 100644 (file)
@@ -1418,7 +1418,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;