git: kernel: forbid ptrace on system processes

Nicolas Thery nth at crater.dragonflybsd.org
Wed Dec 18 01:55:12 PST 2013


commit 763ff625ac026cdc723703d67216df6a4cd5d7d8
Author: Nicolas Thery <nthery at gmail.com>
Date:   Wed Dec 18 10:40:37 2013 +0100

    kernel: forbid ptrace on system processes
    
    The scenario that triggered this change is the GDB test suite which
    tries to attach to process 0 (the swapper).  This dereferenced a NULL
    pointer while reparenting the swapper to GDB as the former has no
    parent.
    
    ptrace(2) is intended for debugging user processes so prevent it
    altogether on system processes as this is deadlock prone.
    
    There were already calls to procfs for preventing accesses to registers
    of system processes.  Remove the now superfluous comments but leave
    these calls as they may be extended someday to check for more
    conditions.
    
    Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2615>

Summary of changes:
 lib/libc/sys/ptrace.2  |  6 +++++-
 sys/kern/sys_process.c | 10 +++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/763ff625ac026cdc723703d67216df6a4cd5d7d8


-- 
DragonFly BSD source repository



More information about the Commits mailing list