execve
Implemented in Antinomie 0.7.0 · Syscall list
Synopsis
Section titled “Synopsis”long execve(const char *filename, const char *const *argv, const char *const *envp);| Number (x86-64) | 59 |
| ABI | 64 |
| Kernel entry point | sys_execve |
This is the raw kernel prototype from the pinned Linux 6.12.94 schema, not the libc wrapper.
Description
Section titled “Description”Replaces the running program with a new executable, with a given argument list and environment.
Arguments
Section titled “Arguments”| Name | Type | Meaning |
|---|---|---|
filename (arg0) |
const char * |
Path of the program to execute. |
argv (arg1) |
const char *const * |
Pointer to the NULL-terminated array of argument strings; argv[0] is conventionally the program name. |
envp (arg2) |
const char *const * |
Pointer to the NULL-terminated array of NAME=value environment strings. |
Return value
Section titled “Return value”On success: nothing on success because the program is replaced; an error otherwise.
In an Antinomie trace the Return column and the ret filter field show the raw kernel return value. On failure that is the negative errno, for example -2 for ENOENT, not the -1 plus errno that the libc wrapper gives. syscall.errno holds the positive errno and syscall.success is false.
Common errors
Section titled “Common errors”| Raw return | Name | Meaning |
|---|---|---|
-7 |
E2BIG |
An argument list or structure is too large. |
-13 |
EACCES |
Permission denied. |
-2 |
ENOENT |
A path component or the named object does not exist. |
-8 |
ENOEXEC |
The file is not in a format the kernel can execute. |
Man page
Section titled “Man page”Captured by Antinomie
Section titled “Captured by Antinomie”Coverage mark: Implemented. Every pointer argument has a capture rule in the pinned kernel patch and none of them records a “no decoder”, “address only” or “not observed” gap on any code path. Individual values can still be incomplete on a particular call; see the capture statuses.
Every call is recorded as an Entry record (the six argument words and the pointees copied at entry) and an Exit record (the return value and the pointees copied at exit).
Arguments
Section titled “Arguments”| Argument | When | How | Recorded field key | Condition |
|---|---|---|---|---|
filename (arg0) |
Entry | the pointer itself, as a raw word | args.0, args.raw[0] |
|
| ↳ pointee | Entry | NUL-terminated string, up to 4,096 bytes (PATH_MAX) | arg0.path |
always |
argv (arg1) |
Entry | the pointer itself, as a raw word | args.1, args.raw[1] |
|
| ↳ pointee | Entry | each argument pointer and then its NUL-terminated string (up to MAX_ARG_STRLEN), until the NULL terminator or the budget | arg1.ptr[i], arg1.string[i] |
always |
envp (arg2) |
Entry | the pointer itself, as a raw word | args.2, args.raw[2] |
|
| ↳ pointee | Entry | each environment pointer and then its NUL-terminated string, with the budget shared with the arguments | arg2.ptr[i], arg2.string[i] |
always |
Family notes
Section titled “Family notes”- The argument and environment vectors are read up to a stack-size budget (at least
ARG_MAX, otherwise up to a quarter of the stack limit). A vector that exceeds the budget recordsarg1.vectororarg2.vectorwith the “invalid extent” status.
Derived and lifecycle records
Section titled “Derived and lifecycle records”- A
lifecycle.exec_commitrecord is emitted when the exec succeeds and the new program image is committed. It is what makes theprocess.exeandprocess.argvfilter fields available. - A
lifecycle.exec_imagerecord names the image that was loaded and, for a script, the interpreter its#!line named, and alifecycle.file_hashrecord (kind Exec) gives the SHA-256 of the committed image, or the reason there is none. Written by a base built for Antinomie 0.7.0 or later.
Filter fields
Section titled “Filter fields”- Result:
ret,syscall.errno,syscall.success,syscall.duration_ns. - Argument words:
args.filename(arg0),args.argv(arg1),args.envp(arg2);args.0toargs.5by position. - Captured strings: the
args.<name>field of a path argument, andargs.path, give the captured text instead of the pointer.
See Syscall Trace filter for the full syntax.
For what the capture statuses mean, see Capture statuses. For what is never recorded, see Known gaps.