lkml.org 
[lkml]   [2003]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: 2.4+ptrace exploit fix breaks root's ability to strace
    On Sat, 22 Mar 2003, Alan Cox wrote:

    > On Sat, 2003-03-22 at 10:31, Russell King wrote:
    > > Are the authors of the ptrace patch aware that, in addition to closing the
    > > hole, the "fix" also prevents a ptrace-capable task (eg, strace started by
    > > root) from ptracing user threads?
    >
    > Its an unintended side effect, nobody has sent a patch to fix it yet.

    Hi,

    mlafon send a patch to the list:
    --------------------------------------------------------------------
    Date: Wed, 19 Mar 2003 12:28:02 +0100
    From: mlafon@arkoon.net
    To: linux-kernel@vger.kernel.org
    Subject: Re: Ptrace hole / Linux 2.2.25

    The patch breaks /proc/<pid>/cmdline and /proc/<pid>/environ for 'non
    dumpable'
    processes, even for root.

    We need to access theses proc files for processes monitoring.

    Included is a patch to restore this functionnality for root.

    Any comments ?
    (See attached file: cmdline_environ_fix.diff)
    --------------------------------------------------------------------

    Nobody responded to his e-mail. I attach the patch again. I will test
    the patch tomorow.


    Cosmindiff -u -r1.3.24.1 ptrace.c
    --- linux-2.4/kernel/ptrace.c 2003/03/19 10:50:57 1.3.24.1
    +++ linux-2.4/kernel/ptrace.c 2003/03/19 10:54:45
    @@ -140,7 +140,7 @@
    /* Worry about races with exit() */
    task_lock(tsk);
    mm = tsk->mm;
    - if (!is_dumpable(tsk) || (&init_mm == mm))
    + if ((!is_dumpable(tsk) || (&init_mm == mm)) && (current->uid != 0))
    mm = NULL;
    if (mm)
    atomic_inc(&mm->mm_users);
    \
     
     \ /
      Last update: 2005-03-22 13:34    [W:0.048 / U:31.152 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site