From nobody Fri Jun 26 22:20:46 2026 X-Original-To: dev-commits-src-branches@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 4gn99V4R56z6j2SV for ; Fri, 26 Jun 2026 22:20:46 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gn99V1Sttz3mLl for ; Fri, 26 Jun 2026 22:20:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782512446; 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=w5hYGIXg2zcTs9NMTGS8QNI0vot2gYvJ0FGhP8wVqOM=; b=G7lQhpJCjzgbfwfx/bSkJZBqHBKyRE0N+rdoWKd26zpCj0N1DCKhpf4I8CQSaizdA0NvxJ 39zqvYeCzIPyaRCmZGdav4fN9+4C70ibMJxGJXfTQNXivnDYj1TchqujuGQ+NUALM8nwW0 Dj0GyuIISlQOrNhDGeVlTuZEG5KH3dwWR1AsCT+a7FHFmON1ty7ploqGIqlPDfWMUCwwqL uP+tZi8REyMtHl6QUjrILk5DymDpuFYaW8trE3uK7t2bF1dy3ozRxUTyGcLV9FHy0O7a0+ WXJf64n2SLhlfBYQ0KpUCiviiRTf/ktOpiI1b6laopSsU+vDQJJeZj8VzpJK1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782512446; a=rsa-sha256; cv=none; b=gCn0LVUDfpMqaB7dprxRJ4y1rzjUuDPa2GIM/eX4qwV4lAXmsJnt5mVpyo9IwkC0oISO8n uypPJwGupXMM7LMMTa4DrKFZ60ZG3nrrPPLTV/a6DwkSedtbCnhxIsmTvnundLI9szWVMs yfUg7aLp8hei8MxjogZ72tHuRBSsPQ4iPfQlQqWxEGUaFYHwo6ynIQ5g9WAgWnNxGV/GBH RCJ720rJAii2ZCL8wXWJfYVbVnS0ruvBwamOZqauhZUOEKq2usCD2KNIM0N5apciz3Dxo9 sK8XYn0cOWzJgvI6eX1r80QnP7g3iWA+awfYqqVwwh0f8zKmJrFScuIiANzfVA== 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=1782512446; 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=w5hYGIXg2zcTs9NMTGS8QNI0vot2gYvJ0FGhP8wVqOM=; b=rkNtYcWTmvLEZdSTxWaWsyyRmt2wnlCGP9h672d+14qOZqDh6v2vdlx66R79amulKKQzMW kokj1sIUcjbrV6vZiF8rPI5RS4moFcLDzy9dHxQrCfC5z8Sm2/c8RI2F5teFPmCx/+P4pl 7598w0JlIK6cpRTJwMzqMzbdrsRwrkpejyouV1HM9uM866roGTTagAXDZGjYXlyHtz6YtV Y68Y+7KvLHs5o3JZJ5bFToSz1ZmWTEl32NkIqrQxQdITJJwBVnVJDTEeULYwkPGC9j1Ehc nJjghoeLBwCNsW8Bx3TPau0YSj+SFHxmokMbDEGc8h4F/a5Y+u0WjcsTgxEL3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gn99V0GJtzxSC for ; Fri, 26 Jun 2026 22:20:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3096e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 26 Jun 2026 22:20:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cbd584772858 - stable/15 - execve_block_pass(9): a helper to wait for the execblock to pass List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/15 X-Git-Reftype: branch X-Git-Commit: cbd58477285888b1b7ff21bdd0bc039f7ffad4ef Auto-Submitted: auto-generated Date: Fri, 26 Jun 2026 22:20:46 +0000 Message-Id: <6a3efb3e.3096e.7b2d1ce7@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cbd58477285888b1b7ff21bdd0bc039f7ffad4ef commit cbd58477285888b1b7ff21bdd0bc039f7ffad4ef Author: Konstantin Belousov AuthorDate: 2026-06-17 19:06:50 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-26 22:16:03 +0000 execve_block_pass(9): a helper to wait for the execblock to pass (cherry picked from commit 450fe67d19eb2ea8e27109214ff21064fdcf808c) --- sys/kern/kern_exec.c | 20 ++++++++++++++++---- sys/sys/imgact.h | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index ed7534af21bf..a3c9a4baa787 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -441,6 +441,21 @@ execve_unblock(struct thread *td, struct proc *p) } } +void +execve_block_pass(struct thread *td) +{ + struct proc *p; + + MPASS(td == curthread); + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + + while (p->p_execblock != 0) { + p->p_flag |= P_INEXEC_WAIT; + msleep(&p->p_execblock, &p->p_mtx, 0, "exeblk", 0); + } +} + /* * In-kernel implementation of execve(). All arguments are assumed to be * userspace pointers from the passed thread. @@ -496,10 +511,7 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, PROC_LOCK(p); KASSERT((p->p_flag & P_INEXEC) == 0, ("%s(): process already has P_INEXEC flag", __func__)); - while (p->p_execblock != 0) { - p->p_flag |= P_INEXEC_WAIT; - msleep(&p->p_execblock, &p->p_mtx, 0, "exeblk", 0); - } + execve_block_pass(td); p->p_flag |= P_INEXEC; PROC_UNLOCK(p); diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index 8c91b3a54bfa..df7d8b2d3908 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -126,6 +126,7 @@ void post_execve(struct thread *td, int error, struct vmspace *oldvmspace); bool execve_block(struct thread *td, struct proc *p); void execve_block_wait(struct thread *td, struct proc *p); void execve_unblock(struct thread *td, struct proc *p); +void execve_block_pass(struct thread *td); #endif #endif /* !_SYS_IMGACT_H_ */