From nobody Tue Apr 28 18:49:41 2026 X-Original-To: bugs@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 4g4qHB0ssbz6bwYS for ; Tue, 28 Apr 2026 18:49:42 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g4qH94WqZz3w3L for ; Tue, 28 Apr 2026 18:49:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777402181; 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: in-reply-to:in-reply-to:references:references; bh=N5XekowMWra+/M5/SosAJK1wAyYoqosbQnSkIwPBLLw=; b=cSMxXBYkATuAn4j4NGvZLZGe49NAfcfEl3SRSgL26xa362OUdotFKWoRsJIMtL+ElNCuBl gUF8u9SmIhAXcsieJYJwuY37kgrIDj+400TNDZDoOFoAHFh3GpYppKs5C8wNZXqraVCMVw ndYoQ6VgmbkvA6+XUqOW01aFqe4ij1woZ3j0tXbm08HIMeHhGZ4alYFhHuO76jDnZk3dCC ThIy6JCe9bXXYpfkz1xRuKCX7cJH6BUAg+ltunbYVvNDHgEx4C48K9GEKyH7VKVvNC/3FW N/AUWfXwNGR7CQA00LdL0VVhbr0ISeZDzrjqfbJ6TC+g2TAOrti/4Rdbad4vmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777402181; a=rsa-sha256; cv=none; b=ktWfa11rMbBhNT5JJWJ20nYsuxMX273c2z7w8UXbEBiVpjKMqfJo08Xd2r7HbwqBkzRnUU Fy3+5IAwhpCEgL50Se6HqNZ8wqz08X75HKScAiZtzLf6uTJT/nou7OVi4HtGR/IQgZeWsZ G2mvbXq5ZTFyBU01QxyRFgH5UZvtvzYLr1GMFYUhzzKqQieyQ2Wguj550EClsYyoQjr/Iy AFQooVulNBGARLKstUY2RD3ATYo0qCAOGU7fyQc7ldy+7bkItR17IJCHtJggh6Dc393Wig kaiWh1EPuMVQV8WPTFiS7FxqRW2LjWSkM+d0VUm3mRreepEHs0MMeIkTjaj8Ng== 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=1777402181; 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: in-reply-to:in-reply-to:references:references; bh=N5XekowMWra+/M5/SosAJK1wAyYoqosbQnSkIwPBLLw=; b=yqfsBfE4gl2iJSLUMhgU/TolsRiObNZKkEPpFRVZPNA49oRTmXW/mCLctknUrud82BdGHC USH3GYsd81W4rZBENy6HdKTvL1/zkx/6VMNN9sJHzIpawFGmZLJCCcFtJhc/SHSO2GSAJv 65CQZDOOllcjFsrDdsoCKtggOvwA8Z59UpxAefCPFDI7/L+5pJRbuTOWr/lgpjbX2ohRoD hA3LF3Yuc9bw/IZfPT8XBUKwBTQ0qKxzrxT3+776ECI9EXGm4uDk8G8p7C2Go0osSPaFOD QHRnr9IGZLmZtITWir3PcGHQFSofqPN9tWmgLH084N8uMsejTQtD0kXXAyHrhA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4g4qH945yRz15Zx for ; Tue, 28 Apr 2026 18:49:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 63SInfZv042868 for ; Tue, 28 Apr 2026 18:49:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 63SInfRJ042867 for bugs@FreeBSD.org; Tue, 28 Apr 2026 18:49:41 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 294780] fexecve(2) only works for scripts if /dev/fd is mounted with the non-default nodup option. Date: Tue, 28 Apr 2026 18:49:41 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kevans@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D294780 Kyle Evans changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kevans@freebsd.org, | |kib@FreeBSD.org --- Comment #1 from Kyle Evans --- I only spent a minute looking at the fexecve(2) implementation, so CC kib@,= but I think the official response is probably: just don't do that. I note the following comment: ``` /*=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 * If the descriptors was not opened with O_PATH, then=20= =20=20=20=20=20=20=20=20=20 * we require that it was opened with O_EXEC or=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 * O_RDONLY. In either case, exec_check_permissions()=20= =20=20=20=20=20=20=20=20=20 * below checks _current_ file access mode regardless=20=20= =20=20=20=20=20=20=20=20=20 * of the permissions additionally checked at the=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 * open(2).=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 */=20=20=20=20=20=20=20=20=20=20=20=20 ``` You're not benefiting yourself by opening it O_EXEC because it will be re-checked, you might as well just open it O_RDONLY and use faccessat(2) wi= th AT_EMPTY_PATH to see if you should even try fexecve(2) since your userland checks are racey anyways, given the above. I think that solves your proble= m, and I don't know if we want to try and do anything else here. --=20 You are receiving this mail because: You are the assignee for the bug.=