Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Apr 2024 02:45:20 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: bfafc6a86ddb - stable/13 - thread_single(9): decline external requests for traced or debugger-stopped procs
Message-ID:  <202404040245.4342jKNH060840@gitrepo.freebsd.org>

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

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

commit bfafc6a86ddb4d278ceacab3d83b3e19b0cb33ff
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-03-27 12:29:25 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-04-04 02:43:56 +0000

    thread_single(9): decline external requests for traced or debugger-stopped procs
    
    (cherry picked from commit 9241ebc796c11cf133c550f188f324bd2c12d89a)
---
 sys/kern/kern_thread.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 14015ef5fdc2..75a10a0810f0 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -1205,6 +1205,9 @@ thread_single(struct proc *p, int mode)
 				return (1);
 			msleep(&p->p_flag, &p->p_mtx, PCATCH, "thrsgl", 0);
 		}
+		if ((p->p_flag & (P_STOPPED_SIG | P_TRACED)) != 0 ||
+		    (p->p_flag2 & P2_WEXIT) != 0)
+			return (1);
 	} else if ((p->p_flag & P_HADTHREADS) == 0)
 		return (0);
 	if (p->p_singlethread != NULL && p->p_singlethread != td)



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