• Andrew Morton's avatar
    [PATCH] remove lock_kernel() from exec of setuid apps · 3b149cc7
    Andrew Morton authored
    Patch from Manfred Spraul <manfred@colorfullife.com>
    
    exec of setuid apps and ptrace must be synchronized, to ensure that a normal
    user cannot ptrace a setuid app across exec.  ptrace_attach acquires the
    task_lock around the uid checks, compute_creds acquires the BLK.  The patch
    converts compute_creds to the task_lock.  Additionally, it removes the
    do_unlock variable: the task_lock is not heaviliy used, there is no need to
    avoid the spinlock by adding branches.
    
    The patch is a cleanup patch, not a fix for a security problem: AFAICS the
    sys_ptrace in every arch acquires the BKL before calling ptrace_attach.
    3b149cc7
exec.c 29.5 KB