Expand description
The image a process executes, which its /proc/<pid>/exe link names.
Detcore records it at each exec, on every backend, and checks it against
the kernel’s own link when the exec completes (tool_global). Where the
backend’s own procfs is not the guest’s kernel procfs (KVM), the caller’s
own link (/proc/self/exe and its other spellings) is answered from the
record while it still names exactly the image the process executes
(ExecRecord::names_path_exactly; Detcore::readlink_own_task_link,
package K slice E1); otherwise it is answered as before. Where the
kernel’s link names a launcher in the guest’s place (SaBRe’s loader,
DynamoRIO’s library; Detcore::launched_exe), the record answers every
process’s link while the image is at its path, as before. The kernel’s
link stands elsewhere.
Only the path is recorded. Where the image ends, which a program-break model would need, is known only once the image is loaded, and nothing reads it yet.
Structs§
- ElfLayout
- What decides where Linux starts a process’s program break after it execs
an ELF image (
load_elf_binary, fs/binfmt_elf.c), from the image’s file header and program headers. - Exec
Record - The image a process executes.
Enums§
- BrkCheck
- What Detcore found when it checked its model of a process’s program break
(
ElfLayout::start_brk) against the kernel’sstart_brk.
Functions§
- auxv_
entry - The value of entry
keyin an auxiliary vector read from/proc/<pid>/auxvasauxv, native-endian pairs ended byAT_NULL. - load_
bias - The load bias of the image file at
pathwith inodeino, in a process whose/proc/<pid>/mapsreadsmaps: the start of the file’s executable mapping at the text segment’s offset less the text segment’s address (ElfLayout::text), or why there is none. The executable mapping, because a launcher may also map the file to read it (SaBRe’s rewriter maps it read-only at offset 0) and may not map the image’s first page at all. The file is matched by inode and its whole pathname as the reader sees it, not by device: maps shows the superblock’s device, which on btrfs and overlay is not thest_devastatof the file reports. Where several such mappings give different biases, there is no answer. This is how Detcore finds an image’s bias where the kernel exec’d a launcher, whoseAT_PHDRthe process’s auxiliary vector holds. - program_
interpreter - The program interpreter (
PT_INTERP) the ELF64 image atpathnames, which the kernel opens and maps at the exec (load_elf_binary, fs/binfmt_elf.c), orNonefor any other file, an image without one, and one the caller cannot read. Like the kernel, this refuses a name shorter than 2 or longer thanPATH_MAXbytes or one whose last byte is not NUL, and the name is the string up to its first NUL, whichopen_execopens. - stat_
start_ brk - The kernel’s
start_brkin a/proc/<pid>/statline: field 47, counted past the command, which may hold spaces and parentheses.