From nobody Wed Jul 8 02:58:06 2026 X-Original-To: dev-commits-src-main@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 4gw2pQ5bwNz6kW31 for ; Wed, 08 Jul 2026 02:58:06 +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 4gw2pQ4GLJz3fbh for ; Wed, 08 Jul 2026 02:58:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783479486; 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=i3M7QSBcLqouQA0vGAQf+IzmFNIrosrwCrLP/CFyTW0=; b=x4EFVrqoLFe9pxzHi8rU1v1lwDE5XKKZKgO3173Ql7/Ka/eH/iHwLkLHw5YuDBN5RPBJgz Ba+kfUZ9zOLuH7FYUirtf4Rj/cxo258xCNUpYcyzmhhRWz24mndwZJhhdKYwmB9g5M7Jcc qf6dbPnnd9e3Ulnp6OavujDDcxO5D5TW3516QACcYlgocqYJO/a7+vSAXC87c7wSJ2Y43r NqZB5+u4JgmmH/jiys1OiSDJ18qhVpgTLZ4xZcMtsSICwW/EwxIINxVROTpnXKNE9fl0UY wSEsj4Cnh7+iyucyBru/kWNK9NmdIvK2FifcS9jD7oCQ+0UvZ/Gc+m1Yw7XCJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783479486; a=rsa-sha256; cv=none; b=Qi42ZqWzae/OUcrjrvUtNxhmB28IbQFkSaAxH/9XM17agQgP8HVV+xSYOrltcIbJlRpUeu 5ARg270b4O0cxhl2GDm77gZN/G4/x7yqk22oBVGG0toarfvB++u1548y+YAAS187b4r4UR scsw5AQhVogAiaRoTsHAFryNpNFElTwhbfA3WGnJcwk6dpBL44nKnbHJKNbkaSYFkXdZon 3BEu0TMlozToOzEnnYVInzRAAMS1mDIMd4E2dsnBp0r2PFGFbG/cZ8zklUEcDonHocopfW ZekMiCFi2W2Ou9/K1c26eM8XzYP6/M2nmEfi5OIQfolHjfAyJZmvF1hFUBQzwA== 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=1783479486; 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=i3M7QSBcLqouQA0vGAQf+IzmFNIrosrwCrLP/CFyTW0=; b=yFEt2mGLHs3G/o05OuqSmk5//cjBe1g04K9soJOBcJU4Y8viJlX0sv/Y3ofJPC29ZspFQO THQzaiZMrz6j4Xo7A19zT1u4bTs2uTvl/sl2Sw2EEIXXXfUjYXfaWyxSYlbLlN9g7QY2vL OAZhuA+x5uCGve3vZ/XQGKK8SiNILtLuq3k/uNbuvbgUgBOa6SJknbqvFC7vYBw0NREGTI wFnzSM62orlWaLs928YTtLrfe6VyFhQyun40+U+dOj4tBBL4oX335nTiA9hxNq9zZeG89z 0LdvTnCc8H5YFG+QYHD02HKi1b3pp3nHLazb6ktSnjKqRtbTB+C9C4F3QCTI/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gw2pQ2lvYz12tM for ; Wed, 08 Jul 2026 02:58:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 206a5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 08 Jul 2026 02:58:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f5329a0d1471 - main - kern: imgact: fix imgp->interpreted List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5329a0d14712ae990f650286a6d5a04617c7cb3 Auto-Submitted: auto-generated Date: Wed, 08 Jul 2026 02:58:06 +0000 Message-Id: <6a4dbcbe.206a5.6a28725a@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f5329a0d14712ae990f650286a6d5a04617c7cb3 commit f5329a0d14712ae990f650286a6d5a04617c7cb3 Author: Kyle Evans AuthorDate: 2026-07-08 02:56:38 +0000 Commit: Kyle Evans CommitDate: 2026-07-08 02:56:38 +0000 kern: imgact: fix imgp->interpreted This is a mask, so the new value should have taken the next bit to avoid breaking a shell script that's interpreted by a binmisc-activated interpreter. Add a brief note that the new value is only used within the ELF activator. Fixes: 389c124fecb0 ("imgact_elf.c indicate that interpreter [...]") Reported by: "polyduekes" on discord, madpilot Reviewed by: kib, sjg (both previous version) Differential Revision: https://reviews.freebsd.org/D58063 --- sys/kern/imgact_elf.c | 4 ++-- sys/kern/kern_exec.c | 3 +-- sys/sys/imgact.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index a0dc96e74ed6..7c78d66b3648 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -823,8 +823,8 @@ __elfN(load_interp_file)(struct thread *td, const char *file, u_long *addr, imgp->td = td; imgp->proc = td->td_proc; imgp->attr = attr; - imgp->interpreted = IMGACT_INTERP_IGNORE; /* ignored by do_execve */ - + imgp->interpreted = IMGACT_INTERP_ELF; /* ignored by do_execve */ + NDINIT(nd, LOOKUP, ISOPEN | FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE, file); if ((error = namei(nd)) != 0) { diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index b6f2848f800c..03a05c6cc041 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -750,8 +750,7 @@ interpret: * Special interpreter operation, cleanup and loop up to try to * activate the interpreter. */ - if (imgp->interpreted != 0 && - imgp->interpreted != IMGACT_INTERP_IGNORE) { + if ((imgp->interpreted & ~IMGACT_INTERP_ELF) != 0) { exec_unmap_first_page(imgp); /* * The text reference needs to be removed for scripts. diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index bf0453beec1f..155db3c7cb6b 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -86,7 +86,7 @@ struct image_params { struct ucred *newcred; /* new credentials if changing */ #define IMGACT_SHELL 0x1 #define IMGACT_BINMISC 0x2 -#define IMGACT_INTERP_IGNORE 0x3 +#define IMGACT_INTERP_ELF 0x4 /* only used within the ELF activator */ unsigned char interpreted; /* mask of interpreters that have run */ bool credential_setid; /* true if becoming setid */ bool vmspace_destroyed; /* we've blown away original vm space */