From nobody Wed Jul 8 02:58:06 2026 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 4gw2pW4xmYz6kVcr for ; Wed, 08 Jul 2026 02:58:11 +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 4gw2pW40Zmz3fhD for ; Wed, 08 Jul 2026 02:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783479491; 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=fPeykB73X+N4Xo6Jgd+3WsljcIX9o8d4Ky2Ti6cTEmX4djvPhi89qZEZVLSooppn2ji0ck cBvpPJbzowtchEqkh+QNrbK9PPXR3xuyD2DBY5Sx5IJ54oB+Js2HYLbABWeG2NEASeK7+p ivzrRGTk9Wsr4zsacePBX5v5uZ5X9XVbytTzi7J7ej633o+joj2/X1aipqnCF6gcrqOUSg BOR39+cJ8VoJTWJ61M3V7IxdtwDMaaVQWDgpIBzSsCzyh26ig4F5wD5xllv/TIvnjcFAXW O4GXFuDfYBN6QZ4BjjbTCinc2qnJECLwzoRR+ERbAY2vCNTjXdVVsY27uyqK0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783479491; a=rsa-sha256; cv=none; b=n/w+vCX+utzpzcKPn0fOUPp5Yo3zIsIDHCaf3Ma/dN3DCb9W0W+/gt0fUJRUmt+TBymfo/ 4CCnh/YFe6f0+jQOYfyZ91MSzet1SeJsBzS/tNPoHRipki5aIvtMY5RmCtrZLZv5PxPaSf Z48WwfsAV/KnyDtn66TybjeTqpDkOcRMMbd8C2jyb/9jtvCupqHCRHbCLv5Xtb8O9PRCsj hHAB99QvatgHtiRM0iJV7hlClL2b6MH1jvQbhpFERvcEjp2RLhkrs9CMZ0i23CyfrpbiD8 2ISyXTJ+KkXlAHEZDWg01Pez4cIcggul3/ZsiPJjboo4CQJyy+rk+jYU+QFtDQ== 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=1783479491; 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=P3I+Xtuf+kpgnzQcFSeEAdKe1KJn0yZ1s/fc0hrTD6rwmLVuHxi1lo61gpR/qkpZnFism3 RZvTpM61ecmM9cJleDQu2KrnainOYbngH7R6Q4XX/MERGS8JpXGXpOT9s0iYGicp3bjuIn FyI3HU8GhhaiXdS/E+SAYmap0gYO9lFaLDtJwVkmm631YlaNnSepor1P32/t7u6LAtt5Wp IrKFnKiTlFui0ax39oZwH85JOCs8wCtEzVViwbwPKUd+MqdqWiZyef5MrWZk558M/BlonQ 2WirEOjs0jA2CQpOLQkVPcG9G/qTOR52wqGZZtNctm6CR/yUiVdbpFi20yLOyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gw2pW33snz12wK for ; Wed, 08 Jul 2026 02:58:11 +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 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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 */