[Bug 294780] fexecve(2) only works for scripts if /dev/fd is mounted with the non-default nodup option.

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 28 Apr 2026 19:29:58 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294780

--- Comment #5 from Kyle Evans <kevans@freebsd.org> ---
(In reply to Jan Bramkamp from comment #4)

Thanks.  In the meantime, looking at the fexecve(2) docs:

     The fexecve() ignores the file offset of fd.  Since execute permission is
     checked by fexecve(), the file descriptor fd need not have been opened
     with the O_EXEC flag.  However, if the file to be executed denies read
     permission for the process preparing to do the exec, the only way to
     provide the fd to fexecve() is to use the O_EXEC flag when opening fd.
     Note that the file to be executed can not be open for writing.

I agree that we could seize the opportunity to explicitly mention the
interpreter problem here as a reason one might not want O_EXEC.

-- 
You are receiving this mail because:
You are the assignee for the bug.