From nobody Tue Apr 28 19:13:38 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 4g4qpq16BMz6bxtp for ; Tue, 28 Apr 2026 19:13:39 +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 4g4qpp4czdz43pN for ; Tue, 28 Apr 2026 19:13:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777403618; 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=JmK2LXFjgtTWlaUfwNGdi94qJDZsuB+T66zaiA/cGE0=; b=xp72NX+J6Cvy2o2sTUWJWz+jmaG1mg3aH/x/yPMlOuE1nv4CvQnIjcEzoIS9MbMT57mAro tAy7xgugeLMF25m3Gu0VlJVCMf9gDWYzQ44hnTPTUjAoxzVJbO592grOYpOBEidZ/T1HO8 iqCSgz2vvTtH4nrelAKUUvnM8HeyCkzYjk2X0O6KXWRs4qMvWzrlBEKOrG5UfH0qjYz5IY wiqJemwXpq3hwNKVAYnmhOl7lVxjxD7QaVfyRpNOiEEvfU6/9cmPTHS5hpjvP0djbfwNCU q7UFL5+LP3xD+sjBCQGDjZ5hmf7Ss79/DJW8I0q6MDrmWpSqVEvtnFWl/i9h5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777403618; a=rsa-sha256; cv=none; b=hzsaiDFY8ZJKx0fx70tYb9xnoQu9cXZWzmKOQVX4A5of3lVh33UtClQ5Jz8U4ZL4WNaBGZ iOxtaswjgDAoWV8TThXNF5ZB6iR7Dd9l8DULG6GcpjEu5q3CID/sErjRAdPUmiLohny+1g hf9Erk6Gjn1SgO4M2nTF1DGVnEiV1s+FYpCuxVKgOa7hOpcIw1vzKPEPIQAMrGGWOH32AE LKzqWM4pXDUmi4ex19eL6M1puWDDPZtDIz3juHbs3TsfmR2EdN4JCtNC0gfQLoOqJE1Whp llrjjOqjCoD+EqGWFgiUW0ELN37qbCLTmTa/dGnv66WUPmRWUAkGDi3EEerU0Q== 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=1777403618; 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=JmK2LXFjgtTWlaUfwNGdi94qJDZsuB+T66zaiA/cGE0=; b=asVvXFRJhPP791HLxFjmhsuOi9i4Dke/BWVdSPoATvk7HIvEWoBRH9HGoQ3sVZYXlnKOuE NU8NilAttxSLlhZKdjAEMDsVo9wBnG8jc8wjGiQKqk2/WLwR7FrdP0iWvzhRF39lwi9mZZ k0SzZaFks6WHCjgbpRQC3QzNM3zSioDvqMJADw8oaDE1d3ZWVsmKSv1HwRsBIFy7H29bry zVpdCmuMqCh8B+1uXn8sz2Vy7LqPf5C8B3RNgc56BPeVA6tVZT1//ynWXDmrg8Y5XDsrbQ zU1XLVi+Tv0Z3BVFuI7yHMV2zcUbGVx4x29esZJrW6WXAoWq/svVJTqjI7isxw== 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 4g4qpp45pGz169x for ; Tue, 28 Apr 2026 19:13:38 +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 63SJDcph087752 for ; Tue, 28 Apr 2026 19:13:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 63SJDcj1087751 for bugs@FreeBSD.org; Tue, 28 Apr 2026 19:13:38 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 19:13:38 +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: crest@bultmann.eu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 --- Comment #2 from Jan Bramkamp --- I wanted to avoid reresolving the name, by opening it once for reading, then reopening it for execution with O_EMPTY_PATH. This works if and only if /de= v/fd is mounted with the non-default "nodup" option. In this configuration the descriptor gets reopened both my code with O_EXEC and later by the interpre= ter as O_RDONLY. Next I wanted to make my code work with the default /dev/fd mounted without= any options (other than "rw"). For any interpreter to be able to run a script it needs to read it (which doesn't count as execution), but to launch the scri= pt with fexecve() the descriptor needs to be executable. For fexecve() to be usable with scripts **at all** and the default mount option a single file descriptor has to have both read and execute capability. For now I accepted the mostly theoretical race condition and use execve(2) instead of fexecve(2). Still the fexecve(2) system call should support runn= ing scripts just like execve(2). If not this limitation must be clearly documen= ted to safe future would be users from wasting time debugging this problem agai= n. --=20 You are receiving this mail because: You are the assignee for the bug.=