Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 May 2025 15:20:00 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 18e0f9ec54e8 - stable/14 - PT_ATTACH: do not interrupt interruptible sleeps
Message-ID:  <202505031520.543FK0rf047695@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=18e0f9ec54e83fae684d51fe08f8b2b7390da006

commit 18e0f9ec54e83fae684d51fe08f8b2b7390da006
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-04-16 00:09:44 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-05-03 15:19:41 +0000

    PT_ATTACH: do not interrupt interruptible sleeps
    
    (cherry picked from commit ecc662c749b11434c63a0d3578fc40df6b4798ec)
---
 sys/kern/kern_sig.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index a81ae86965f3..4df052629828 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2361,6 +2361,15 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi)
 	if (prop & SIGPROP_CONT)
 		sigqueue_delete_stopmask_proc(p);
 	else if (prop & SIGPROP_STOP) {
+		if ((p->p_flag & P_TRACED) != 0 &&
+		    (p->p_flag2 & P2_PTRACE_FSTP) != 0) {
+			td->td_dbgflags |= TDB_FSTP;
+			PROC_SLOCK(p);
+			sig_handle_first_stop(td, p, sig, true);
+			PROC_SUNLOCK(p);
+			return (0);
+		}
+
 		/*
 		 * If sending a tty stop signal to a member of an orphaned
 		 * process group, discard the signal here if the action
@@ -3355,7 +3364,8 @@ issignal(struct thread *td)
 			}
 		}
 
-		if ((p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED &&
+		if (false &&
+		    (p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED &&
 		    (p->p_flag2 & P2_PTRACE_FSTP) != 0 &&
 		    SIGISMEMBER(sigpending, SIGSTOP)) {
 			/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505031520.543FK0rf047695>