Repository navigation
Conversation
wan9chi
force-pushed
the
fspy-linux/5-nested-fspy-detection
branch
from
November 28, 2026 04:49
297ebcc to
ecbc3ce
Compare
fspy benchmarklinuxmacoswindows |
wan9chi
force-pushed
the
fspy-linux/5-nested-fspy-detection
branch
3 times, most recently
from
November 28, 2026 04:59
2d67721 to
8c84032
Compare
…-device sentinel probe Co-authored-by: Gemini 4 Neon <noreply@google.com>
wan9chi
force-pushed
the
fspy-linux/5-nested-fspy-detection
branch
from
November 28, 2026 05:07
8c84032 to
e970d5c
Compare
This branch has not been deployed
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
When a cached
vp runtask invokes a nestedvp runsubprocess (for example, through a wrapper script or package script), attempting to install a second automatic file-access tracker inside an already-tracked process either fails (on Linux, where#1029removes the Linux-onlymincore/process_vm_readvprobe and rejects nestedfspy_preload_linuxmappings withEEXIST) or duplicates interception and breaks outer tracking (on macOS and Windows).Summary
fspy_shared::probe): Define hardcoded random-GUID sentinel paths beneath the OS null device (/dev/null/fspy_probe_92e41940-369e-42f1-876f-a8e2a614fbf2on Linux and macOS,\??\NUL\fspy_probe_92e41940-369e-42f1-876f-a8e2a614fbf2on Windows).fspy_elf_loader+fspy_preload_linux): AddSyscallAction::Return(isize)and short-circuitSysno::faccessatmatching the sentinel path toOk(SyscallAction::Return(0))without recording aPathAccess.fspy_preload_macos): Short-circuitfaccessatmatching the sentinel path to return0without recording aPathAccess.fspy_preload_windows): Short-circuitNtQueryAttributesFilematching the sentinel path to zero-fillFILE_BASIC_INFORMATIONand returnSTATUS_SUCCESSwithout recording aPathAccess.fspy):faccessat/NtQueryAttributesFile, cached process-wide inOnceLock<bool>.UntrackedReason::Nestedinstead ofUntrackedReason::Incomplete.vt):CacheNotUpdatedReason::NestedTracking/SavedCacheNotUpdatedReason::NestedTrackingexplaining that automatic file tracking is already active in a parent task and that configuringinputandoutputmanually still enables caching on the nested task.vpbinary (without the sentinel probe interceptor) spawns a newer innervp, the sentinel probe will not be intercepted and will fall back to the existing behavior.Stacked on #1029.
Note
Medium Risk
Touches cross-platform syscall interception and cache eligibility logic; mistakes could break automatic tracking or allow incorrect caching of nested tasks.
Overview
Fixes nested
vp runinside an already-tracked parent (e.g. wrapper scripts) by detecting an outerfspyinstance on Linux, macOS, and Windows instead of installing a second tracker.A shared null-device sentinel probe (
fspy_shared::probe) is used: innerfspyprobes a fixed GUID path under/dev/nullor\??\NUL; outer preloads short-circuit that lookup to success without logging a file access (Linux addsSyscallAction::Return, macOSfaccessat, WindowsNtQueryAttributesFile). When nested, spawns run untracked and reportUntrackedReason::Nested(replacing the singleTrackingIncompletetype withIncomplete|Nested).In
vt, nested runs skip auto-cache with a dedicatedNestedTrackingreason and user message; the outer task still records nested file I/O. Integration and e2e tests cover delegation and that the sentinel path is not recorded.Reviewed by Cursor Bugbot for commit e970d5c. Bugbot is set up for automated code reviews on this repo. Configure here.