Expand description
Reading and writing tracee memory from the supervisor.
process_vm_readv/process_vm_writev are used when the container allows
them; otherwise /proc/<pid>/mem is opened per access (the descriptor is
not cached because it would silently read the old address space after an
execve).
In the guest-stub restricted mode the supervisor cannot reach a guest’s
memory at all; the stub copies what a syscall uses into the mailbox (see
guest_stub), whose guest addresses are then served from the
supervisor’s own mapping of it, and every other address is EFAULT.
Structs§
- Mem
- Tracee memory accessor. Cheap to copy; the probe result is global.
Constants§
- MAX_
ARG_ STRLEN - The kernel’s limit on one argument or environment string of an exec
(
MAX_ARG_STRLEN, 32 pages): a longer one fails the exec withE2BIGbefore any supervisor sees it. - MODE_
PROCESS_ 🔒VM - MODE_
PROC_ 🔒MEM - MODE_
UNPROBED 🔒
Statics§
- MODE 🔒
- WINDOWS 🔒
- The mailbox of the guest-stub restricted mode as each ABI’s guests map it: its guest address, its length, and the address of the supervisor’s mapping of it.
Functions§
- in_
window 🔒 - Where
lenbytes at guest addressaddrlie in the supervisor’s mapping of the mailbox, when it is in use. - open_
mem 🔒 - set_
window - Serves every later access from the mailbox mapped at
local. - write_
window 🔒 - Copies
bufinto the mailbox at a placein_windowfound.