HomeFreeBSD

execve: disallow argc == 0

Description

execve: disallow argc == 0

The manpage has contained the following verbiage on the matter for just
under 31 years:

"At least one argument must be present in the array"

Previous to this version, it had been prefaced with the weakening phrase
"By convention."

Carry through and document it the rest of the way. Allowing argc == 0
has been a source of security issues in the past, and it's hard to
imagine a valid use-case for allowing it. Toss back EINVAL if we ended
up not copying in any args for *execve().

The manpage change can be considered "Obtained from: OpenBSD"

Reviewed by: emaste, kib, markj (all previous version)
Differential Revision: https://reviews.freebsd.org/D34045

Details

Provenance
kevansAuthored on Jan 25 2022, 10:47 PM
Reviewer
emaste
Differential Revision
D34045: execve: disallow argc == 0
Parents
rG5cf00496537a: limit sort(1) memory usage to 20% of available main memory
Branches
Unknown
Tags
Unknown