summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.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_sig.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_sig.c')
-rw-r--r--sys/kern/kern_sig.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index e60e09d..45cb4b9 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -3247,7 +3247,8 @@ coredump(struct thread *td)
MPASS((p->p_flag & P_HADTHREADS) == 0 || p->p_singlethread == td);
_STOPEVENT(p, S_CORE, 0);
- if (!do_coredump || (!sugid_coredump && (p->p_flag & P_SUGID) != 0)) {
+ if (!do_coredump || (!sugid_coredump && (p->p_flag & P_SUGID) != 0) ||
+ (p->p_flag2 & P2_NOTRACE) != 0) {
PROC_UNLOCK(p);
return (EFAULT);
}
OpenPOWER on IntegriCloud