Skip to main content

handle_execve

Function handle_execve 

Source
pub fn handle_execve(ctx: &Ctx, regs: &mut Regs) -> Result<(), i32>
Expand description

Rewrites an execve/execveat so the kernel loads host-side files only.

§Arguments

  • ctx - Shared supervisor state.
  • regs - Registers at the stop; edits are committed by the caller.

An empty path is left for the kernel to refuse, unless AT_EMPTY_PATH makes it name dirfd: then the plan is made from the descriptor’s own path, or the working directory’s for AT_FDCWD.

§Errors

ELOOP for too many nested #!, otherwise the errno of reading the tracee or translating a path. A missing or unreadable program is not an error: the translated path is left for the kernel to judge.