Received: by mail.netbsd.org (Postfix, from userid 605) id 3F14684D25; Sun, 7 Apr 2019 14:50:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id B732E84CFD for ; Sun, 7 Apr 2019 14:50:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 2C4KBIMAmX-M for ; Sun, 7 Apr 2019 14:50:41 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 57FBC84CD0 for ; Sun, 7 Apr 2019 14:50:41 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 51FF1FB16; Sun, 7 Apr 2019 14:50:41 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sun, 7 Apr 2019 14:50:41 +0000 From: "Kamil Rytarowski" Subject: CVS commit: src/sys/kern To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20190407145041.51FF1FB16@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Kamil Rytarowski" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: kamil Date: Sun Apr 7 14:50:41 UTC 2019 Modified Files: src/sys/kern: kern_fork.c Log Message: Add a paranoid racy lock check in child_return() In theory a child could be detached for some reason or another during the time window between checking for PSL_TRACED and acquiring proc_lock. Acquire the proc_lock mutex and recheck for PSL_TRACED before emitting SIGTRAP. sigswitch() must acquite it internally anyway so this does not have a negative impact and adds an extra sanity check. For !PSL_TRACED case there is no impact. To generate a diff of this commit: cvs rdiff -u -r1.208 -r1.209 src/sys/kern/kern_fork.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.