lkml.org 
[lkml]   [2008]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] CRED: ptrace_attach() should use the target process's mutex
    Date
    ptrace_attach() should use the target process's mutex when attaching to it,
    not the current (tracer) process's mutex.

    Signed-off-by: David Howells <dhowells@redhat.com>
    ---

    kernel/ptrace.c | 4 ++--
    1 files changed, 2 insertions(+), 2 deletions(-)


    diff --git a/kernel/ptrace.c b/kernel/ptrace.c
    index 893a099..2ee343a 100644
    --- a/kernel/ptrace.c
    +++ b/kernel/ptrace.c
    @@ -174,7 +174,7 @@ int ptrace_attach(struct task_struct *task)
    /* Protect exec's credential calculations against our interference;
    * SUID, SGID and LSM creds get determined differently under ptrace.
    */
    - retval = mutex_lock_interruptible(&current->cred_exec_mutex);
    + retval = mutex_lock_interruptible(&task->cred_exec_mutex);
    if (retval < 0)
    goto out;

    @@ -218,7 +218,7 @@ repeat:
    bad:
    write_unlock_irqrestore(&tasklist_lock, flags);
    task_unlock(task);
    - mutex_unlock(&current->cred_exec_mutex);
    + mutex_unlock(&task->cred_exec_mutex);
    out:
    return retval;
    }


    \
     
     \ /
      Last update: 2008-10-01 17:41    [W:0.023 / U:2.028 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site