ptrace(2): allow ptrace(PT_TRACE_ME) in cap mode

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D59317
This commit is contained in:
Konstantin Belousov committed 2026-09-02 04:00:50 +03:00
1 parent 551b7c5e12
commit c8f8d00c24
1 file changed
+2
+2
View File
@@ -720,6 +720,8 @@ ptrace_check_allowed(struct thread *td, int req, bool pd_mode, pid_t pid)
return (ECAPMODE);
if (pd_mode)
return (0);
if (req == PT_TRACE_ME)
return (0);
if (req == PT_GET_CHILDREN && pid == td->td_proc->p_pid)
return (0);
if (req == PT_CLEARSTEP && pid == td->td_tid)