]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Trim spaces at end of line to record the proper commit message for
authorkib <kib@FreeBSD.org>
Tue, 20 Oct 2015 20:38:20 +0000 (20:38 +0000)
committerkib <kib@FreeBSD.org>
Tue, 20 Oct 2015 20:38:20 +0000 (20:38 +0000)
r289660:

Do not allow to execute ptrace(PT_TRACE_ME) when the process is
already traced.

Do not allow to execute ptrace(PT_TRACE_ME) when there is no parent
which can trace the process, i.e. when the parent is already init.
Note that after the PT_TRACE_ME request the process is unkillable and
non-continuable until a debugger is attached, or parent is killed, the
later clears P_TRACED state.  Since init clearly would not debug the
caller, and cannot be killed, disallow creation of unkillable
processes.

Reviewed by: jhb, pho
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D3908

sys/kern/sys_process.c

index 85be385f3669f2979d1e30f02120c2a9386f66cd..47fbbc1a7889d9565575a7998980d19a48f262e6 100644 (file)
@@ -443,7 +443,7 @@ ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve)
 }
 
 #ifdef COMPAT_FREEBSD32
-static int      
+static int
 ptrace_vm_entry32(struct thread *td, struct proc *p,
     struct ptrace_vm_entry32 *pve32)
 {