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
This commit is contained in:
parent
16a5c008cc
commit
77b9bec37b
@ -744,7 +744,18 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
|
||||
*/
|
||||
switch (req) {
|
||||
case PT_TRACE_ME:
|
||||
/* Always legal. */
|
||||
/*
|
||||
* Always legal, when there is a parent process which
|
||||
* could trace us. Otherwise, reject.
|
||||
*/
|
||||
if ((p->p_flag & P_TRACED) != 0) {
|
||||
error = EBUSY;
|
||||
goto fail;
|
||||
}
|
||||
if (p->p_pptr == initproc) {
|
||||
error = EPERM;
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
|
||||
case PT_ATTACH:
|
||||
|
Loading…
x
Reference in New Issue
Block a user