Skip to content

fix: fall back to an untracked spawn when fspy cannot start - #752

Open
lifeiscontent wants to merge 5 commits into
voidzero-dev:mainfrom
lifeiscontent:fix/vt-untracked-spawn-fallback
Open

lifeiscontent wants to merge 5 commits into
voidzero-dev:mainfrom
lifeiscontent:fix/vt-untracked-spawn-fallback

Conversation

@lifeiscontent

@lifeiscontent lifeiscontent commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Part of #700, split out of #701. Initializing fspy panicked if its preload library couldn't be written to the temp dir, and any failed tracked spawn failed the task.

Changes

  • SPY_IMPL now holds an io::Result. fspy::Command::spawn returns an init failure as SpawnError::Injection instead of panicking.
  • If the tracked spawn fails, vt reruns the command without tracking and sets ChildOutcome::fspy_unavailable. The run isn't cached, and the summary shows "Not cached: file access tracking failed to start".
  • The cache-not-updated flags in summary.rs are grouped into a SuccessDetails struct, which keeps spawn_outcome_from_execution under clippy's argument limit.

This doesn't depend on #701 or #753.

@lifeiscontent
lifeiscontent force-pushed the fix/vt-untracked-spawn-fallback branch from b61e289 to 1ef7ac7 Compare September 23, 2026 23:50
@lifeiscontent
lifeiscontent force-pushed the fix/vt-untracked-spawn-fallback branch 2 times, most recently from bae3882 to 3842cbf Compare September 23, 2026 23:56
Initializing fspy panicked if the preload library couldn't be written
to the temp dir. Return the error from fspy::Command::spawn instead,
and have vt rerun the command without tracking. The task still runs,
isn't cached, and the summary says file access tracking failed to
start.
@lifeiscontent
lifeiscontent force-pushed the fix/vt-untracked-spawn-fallback branch from 3842cbf to 398f824 Compare September 24, 2026 10:38
@lifeiscontent

Copy link
Copy Markdown
Contributor Author

Merged current main and resolved the summary conflict while keeping the new read/write caching behavior from #913. Added a regression test for the tracking-unavailable summary reason.

The vt and fspy tests pass on macOS, as do all 175 enabled end-to-end snapshots. Clippy is clean for both crates. This remains independent of #701 and #753. Could someone review it and approve the workflow runs?

@wan9chi wan9chi added the linux backend The new Linux file tracking backend label Nov 4, 2026
wan9chi added a commit that referenced this pull request Nov 10, 2026
…led (#701)

## Motivation

Fixes #700.

Cached tasks run under fspy, which preloads a library into every spawned
process. For statically linked binaries the preload installs a seccomp
filter before exec. In sandboxes that deny the `seccomp` syscall
(rootless bubblewrap under a restrictive profile, some CI environments)
that install fails with EPERM, and the exec returned the error instead
of running the program. Every spawn in a cached task failed before the
child started.

## Changes

- When the seccomp filter can't be installed, exec and `posix_spawn(p)`
mark the trace incomplete and run the call untracked. All other exec
errors are returned as before, so errors like ENOENT, EACCES and ENOEXEC
still reach the caller unchanged and don't affect caching.
- Each exec variant falls back to its own libc original with its
original arguments. `execvp` and `execlp` still search `PATH`,
`execveat` keeps its dirfd and flags, and `fexecve` keeps its fd (so it
doesn't need `/proc`). `execl`, `execlp` and `execle` can't forward
their varargs, so they fall back to `execv`, `execvp` and `execve` with
the collected argv, which POSIX defines as equivalent.
- Add `Sender::report_loss`, which sets the channel's CLOSED bit so the
run is treated as untracked and not cached from a partial trace.
- The not-cached message now reads "automatic file tracking couldn't
record everything this task did", which covers both a full tracking
channel and this case.

Affected tasks still run but aren't cached. Setting `input` and `output`
explicitly (without `auto`) brings caching back in those environments.

Split out from the original version of this PR:
- #753: the preload no longer aborts its host process when the payload
is missing or the channel can't be opened. Based on this branch.
- #752: vt falls back to an untracked spawn when fspy can't start.
Independent.

---------

Co-authored-by: wan9chi <me@wan9chi.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linux backend The new Linux file tracking backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants