lkml.org 
[lkml]   [2011]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] sys_getppid: add missing rcu_dereference
    Date
    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: Andrew Morton <akpm@linux-foundation.org>
    Cc: Kees Cook <keescook@chromium.org>
    ---
    kernel/timer.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/kernel/timer.c b/kernel/timer.c
    index dbaa624..9c3c62b 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;
    --
    1.7.3.1


    \
     
     \ /
      Last update: 2011-12-07 03:55    [W:0.019 / U:33.504 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site