From nobody Thu Apr 04 02:45:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V95ZT0twtz5GSFy; Thu, 4 Apr 2024 02:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V95ZT04P7z44bZ; Thu, 4 Apr 2024 02:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712198721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9x9ZgISR81RgerLCLG7ZsR/fXMYZ5KDQZCcTI/odsiU=; b=bdJPjtIIyjqkR78b8LBEXH399U1bk9XlsuoC52HeexC32HQOYMD8R7meLfQXFFT3+CaQKF M/Uf3I8dV0e0lKN4K6UwHWjOfi6z40j43wp6o29L1sUSY9Q/m7x0LWh8zITPxM16reSkJM eCSON0fndBpKP3OdyJ7rJvZsQTSKVcTxeMN0lDE+8ensaqvsfY9tCkGRmthbt08E2APfWd OVaV93yV++pxI8+DiZsj9s3/Ag5ubpcE8YULEUQcYzimNAah4qa60D9TvY3r/lSOQe9EDF nxrkSqH6cJbZZLzRlflJL4PWBNPBh1KHoUsyQgrS9Z+QCfW2UT/WiF8nUdQd1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712198721; a=rsa-sha256; cv=none; b=XwYMEyMO4CsjW2zfciuA5zYS3XvHs9ZWuLFyOZNI8JgtX5QEDHGrLVszrrN1b+WjC/bNr9 L8sLlcsRAGHEK8puK+gugi6S3OpNRM4zaoRv49h515PlPQxL7udsDBYha2IkW07Edl+kZ1 ZwIix9UJmeBGzf+P/Psn7GA0haM/KGgRULqFpcuZhibpVKiMcaC0WGdMkJ7UgLw+xbi8Ib fcY2SdwiZNkP4e7MrBDE05Vl2kBL+Ko2Bg54fgnMvq9PUxHfSy9sMC3+XnNerzhqT365/3 cdsQcrpaCc4ze7gHfylDmE6hqGDfXTPMp8BJT8MAdPzutVjO/156rwJIt00/GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712198721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9x9ZgISR81RgerLCLG7ZsR/fXMYZ5KDQZCcTI/odsiU=; b=YxOfQSh2pARN1Px0t4XDTKEkOkZFqjo087ysqoGO2Mvb6OIG072JM394vAguzwwjUr1k/W tum9+qPTeP3qXiVYsKSjR0rnnK26m+G9fIcNlOLiRQJnxCXqGxtlf3VBSGDkpok44CnHM3 P39usmsd8brooMpnGeY1bcmAWGl7dxc99PGJgxeKBEu/hayLvZOAg3ilyt4dVxGFtq8D/O LG9Mu3anv0W7reR4ebMuLiTK7dXmxsdu5G2DHmfGWHOAvji3QTqQf4CnA0YELr++e88vvd efdBFn051ofzEFUSz+p+N5BQ8fg5rBy8Qj+4GyWD54R44SLNjw76/wgF9z57/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V95ZS6n31zybP; Thu, 4 Apr 2024 02:45:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4342jKeg060843; Thu, 4 Apr 2024 02:45:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4342jKNH060840; Thu, 4 Apr 2024 02:45:20 GMT (envelope-from git) Date: Thu, 4 Apr 2024 02:45:20 GMT Message-Id: <202404040245.4342jKNH060840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bfafc6a86ddb - stable/13 - thread_single(9): decline external requests for traced or debugger-stopped procs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bfafc6a86ddb4d278ceacab3d83b3e19b0cb33ff Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bfafc6a86ddb4d278ceacab3d83b3e19b0cb33ff commit bfafc6a86ddb4d278ceacab3d83b3e19b0cb33ff Author: Konstantin Belousov AuthorDate: 2024-03-27 12:29:25 +0000 Commit: Konstantin Belousov 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)