summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-01-18 15:13:11 +0000
committerkib <kib@FreeBSD.org>2015-01-18 15:13:11 +0000
commitaa0ac99391af2cc2286fadd774dc5cf9f2edb7a6 (patch)
tree406845e7428cb2139db4e8afc4299216a84a92a7 /sys/kern/kern_exec.c
parent53832db395278d76a34a15ca534f509564a51dc5 (diff)
downloadFreeBSD-src-aa0ac99391af2cc2286fadd774dc5cf9f2edb7a6.zip
FreeBSD-src-aa0ac99391af2cc2286fadd774dc5cf9f2edb7a6.tar.gz
Add procctl(2) PROC_TRACE_CTL command to enable or disable debugger
attachment to the process. Note that the command is not intended to be a security measure, rather it is an obfuscation feature, implemented for parity with other operating systems. Discussed with: jilles, rwatson Man page fixes by: rwatson Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 19c33b6..5b80f5c 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -634,6 +634,8 @@ interpret:
* it that it now has its own resources back
*/
p->p_flag |= P_EXEC;
+ if ((p->p_flag2 & P2_NOTRACE_EXEC) == 0)
+ p->p_flag2 &= ~P2_NOTRACE;
if (p->p_flag & P_PPWAIT) {
p->p_flag &= ~(P_PPWAIT | P_PPTRACE);
cv_broadcast(&p->p_pwait);
OpenPOWER on IntegriCloud