The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c8f8d00c2422bf7eca71b7b41e9d586ca25c4b8a
commit c8f8d00c2422bf7eca71b7b41e9d586ca25c4b8a Author: Konstantin Belousov <[email protected]> AuthorDate: 2026-09-01 22:14:58 +0000 Commit: Konstantin Belousov <[email protected]> CommitDate: 2026-09-02 01:00:50 +0000 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 --- sys/kern/sys_process.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 5c8f32773412..9b4f8dffddda 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -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)
