Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152524556
D34045.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D34045.id.diff
View Options
diff --git a/lib/libc/sys/execve.2 b/lib/libc/sys/execve.2
--- a/lib/libc/sys/execve.2
+++ b/lib/libc/sys/execve.2
@@ -28,7 +28,7 @@
.\" @(#)execve.2 8.5 (Berkeley) 6/1/94
.\" $FreeBSD$
.\"
-.Dd March 30, 2020
+.Dd January 26, 2022
.Dt EXECVE 2
.Os
.Sh NAME
@@ -273,6 +273,9 @@
The new process file is not an ordinary file.
.It Bq Er EACCES
The new process file mode denies execute permission.
+.It Bq Er EINVAL
+.Fa argv
+did not contain at least one element.
.It Bq Er ENOEXEC
The new process file has the appropriate access
permission, but has an invalid magic number in its header.
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -356,6 +356,12 @@
exec_args_get_begin_envv(args) - args->begin_argv);
AUDIT_ARG_ENVV(exec_args_get_begin_envv(args), args->envc,
args->endp - exec_args_get_begin_envv(args));
+
+ /* Must have at least one argument. */
+ if (args->argc == 0) {
+ exec_free_args(args);
+ return (EINVAL);
+ }
return (do_execve(td, args, mac_p, oldvmspace));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 16, 11:59 AM (13 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31601493
Default Alt Text
D34045.id.diff (1 KB)
Attached To
Mode
D34045: execve: disallow argc == 0
Attached
Detach File
Event Timeline
Log In to Comment