Repository navigation
Conversation
…tives Add low-level `no_std` filesystem, I/O, and allocator-backed path resolution primitives needed by the freestanding Linux ELF/SIGSYS tracker and shared Unix exec resolver: - `fspy_nostd`: `Error::ACCES`, `pread`, `faccessat`, `stat`/`fstat`, `getcwd`, `readlinkat`/`fcntl_getpath`, plus unit tests. - `fspy_nostd_alloc`: allocator-backed `getcwd`, `fd_path`, `resolve_path_at`, and pooled bump allocator helpers, plus unit tests. - `vt_ipc_str`: `IpcStr::as_bytes` for Unix and `target_os = "none"`. - `fspy_shared`: gate host dev-dependencies on `not(target_os = "none")`. Co-authored-by: Gemini 4 Neon <noreply@google.com>
fspy benchmarklinuxmacoswindows |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6730e4b. Configure here.
Co-authored-by: Gemini 4 Neon <noreply@google.com>
…r decoding
- Wrap `PageBump` like `PooledBump` with unconditional `#[inline(never)]` on
`allocate`/`deallocate`/`grow` and drop unused `allocate_zeroed`/
`grow_zeroed`/`shrink` overrides
- Avoid panicking on odd byte lengths in Windows `IpcStr::to_os_string`
- Export `fspy_nostd_alloc::fs::format_proc_self_fd` for reuse
- Use `linux_raw_sys::general::{PATH_MAX, X_OK}` instead of literals in
`fspy_nostd::fs::linux`
- Tighten `BorrowedFd::try_borrow_raw` to accept only `fd >= 0 || fd == CWD_RAW`
- Remove dead/unreachable code (`mac::getcwd_small`, `Error::NOSYS`,
`AtFlags::REMOVEDIR`, and unreachable `OVERFLOW` fd conversions in Linux fs)
Co-authored-by: Gemini 4 Neon <noreply@google.com>
Co-authored-by: Gemini 4 Neon <noreply@google.com>
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
Replacing Linux
LD_PRELOADandseccomp_unotifywith an in-process freestanding (target_os = "none") ELF/SIGSYSlauncher requiresno_stdUnix filesystem, I/O, and allocator-backed path-resolution primitives shared between the freestanding Linux launcher and the macOS preload library.Changes
fspy_nostd: addError::ACCES(plus.typos.toml),pread,faccessat,stat/fstat,getcwd,readlinkat/fcntl_getpath, andOwnedFd::from_raw_fd, with unit tests.fspy_nostd_alloc: add allocator-backedgetcwd,fd_path,resolve_path_at, andPooledBumphelpers, with unit tests.vt_ipc_str: exposeIpcStr::as_bytesfor Unix andtarget_os = "none".fspy_shared: gate host dev-dependencies onnot(target_os = "none")for bare-metal builds.Stack created with GitHub Stacks CLI • Give Feedback 💬
Note
Medium Risk
Touches low-level syscalls, fd borrowing rules, and allocation in constrained stack contexts; broad test coverage limits but regressions could affect path resolution in intercept code.
Overview
Adds no_std / syscall-level Unix primitives and allocator-backed path resolution so freestanding Linux and macOS preload code can inspect paths and fds without libc malloc.
In
fspy_nostd, expandsErrorerrno coverage (includingACCES),pread,faccessat/AccessFlags,Stat::is_regular_file, Linuxfcntldup/CLOEXEC helpers, and tightensBorrowedFd::try_borrow_rawto acceptAT_FDCWDas well as non-negative fds.OwnedFd::from_raw_fdis now public. macOSgetcwdrequires aPATH_MAXbuffer and drops the small-buffer fallback.In
fspy_nostd_alloc, addsfd_path,resolve_path_at, and Linuxformat_proc_self_fd, plusPageBump/PooledBumpwrappers with#[inline(never)]allocator methods to keep bump allocation from bloating stack frames in signal/vfork-sensitive contexts.Smaller follow-ons:
IpcStr::as_byteson Unix/none, safer Windowsto_os_stringfor odd byte lengths,fspy_shareddev-deps gated offtarget_os = "none", and.typos.tomlforACCES.Reviewed by Cursor Bugbot for commit 2c0d2ed. Bugbot is set up for automated code reviews on this repo. Configure here.