git: 0de1f3a8aa7f - stable/14 - fexecve(2): call out a scenario where you want !O_EXEC
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 10 Jun 2026 04:01:04 UTC
The branch stable/14 has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=0de1f3a8aa7f5e99aa63bcd76dfa3fd7e017d295
commit 0de1f3a8aa7f5e99aa63bcd76dfa3fd7e017d295
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2026-05-01 03:02:55 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-06-10 04:00:46 +0000
fexecve(2): call out a scenario where you want !O_EXEC
We note a reason why you might need it, but there's an equally important
reason you may need to omit it: interpreted programs. Add a note
accordingly, along with the workaround configuration if there's reason
you can't help it.
PR: 294780
Reviewed by: Jan Bramkamp <crest_freebsd_rlwinm.de>, kib
(cherry picked from commit 9c18d55a768a3e60ecaba1325e9a3e00a25dee26)
---
lib/libc/sys/execve.2 | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/lib/libc/sys/execve.2 b/lib/libc/sys/execve.2
index ca5dbd09beee..22ffa268b220 100644
--- a/lib/libc/sys/execve.2
+++ b/lib/libc/sys/execve.2
@@ -27,7 +27,7 @@
.\"
.\" @(#)execve.2 8.5 (Berkeley) 6/1/94
.\"
-.Dd January 26, 2022
+.Dd June 8, 2026
.Dt EXECVE 2
.Os
.Sh NAME
@@ -231,6 +231,17 @@ is to use the
.Dv O_EXEC
flag when opening
.Fa fd .
+Opening without
+.Dv O_EXEC
+may be necessary in the case of executing an interpreted program, as the
+interpreter will not be able to acquire a descriptor to the script for reading
+without mounting
+.Xr fdescfs 4
+on
+.Pa /dev/fd
+with the
+.Cm nodup
+option.
Note that the file to be executed can not be open for writing.
.Sh RETURN VALUES
As the