fix(fspy): run processes untracked when injection fails - #701
Open
lifeiscontent wants to merge 1 commit into
Open
fix(fspy): run processes untracked when injection fails#701lifeiscontent wants to merge 1 commit into
lifeiscontent wants to merge 1 commit into
Conversation
In restricted sandboxes that deny the seccomp syscall, every spawn in a cached task failed with EPERM: the preload installs a seccomp user-notification filter before exec'ing a static binary, the install was refused, and the interposed exec returned the error instead of running the program. Tracking must never break the traced process. The exec and posix_spawn hooks now mark the run's trace incomplete and execute untracked with the original arguments when injection fails. The preload constructor no longer aborts the host process on a missing or malformed payload, and vt falls back to an untracked spawn when the tracked spawn itself fails (e.g. the preload library cannot be written to a read-only temp dir). Runs with escaped processes are reported as not cached, never cached from a partial trace; declaring explicit input/output config (without auto) still caches in such environments. Fixes voidzero-dev#700.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Fixes #700.
Cached tasks run under fspy file tracking, which injects a preload library into every spawned process. For statically linked binaries the preload installs a seccomp user-notification filter before exec. In sandboxes that deny the
seccompsyscall (rootless bubblewrap under a restrictive outer profile, some CI environments) that install fails with EPERM, and the interposed exec returned the error instead of running the program — every spawn in a cached task failed before the child ran.Two adjacent failure modes had the same shape: the preload constructor aborted the host process when
FSPY_PAYLOADwas missing or malformed (e.g. a leakedLD_PRELOADin an env-scrubbed sandbox), and vt panicked when the preload library could not be written to the temp dir.Tracking is observability; it must never break the process being traced.
Changes
Sender::report_losson the shm channel sets the CLOSED gate, so a run with an escaped process is treated as untracked and never cached from a partial trace.Affected tasks run normally but are not cached; declaring explicit
input/output(withoutauto) restores caching in such environments.