You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(fspy-shared): make the payload a borrowed view
The payload and its channel configuration are now views over storage
their producer owns, the model the Windows preload already had with its
static Detours page:
- ChannelConf borrows its two paths; channel() returns only the
Receiver, and Receiver::conf() derives the configuration from
receiver-owned C strings (the lock path now stored beside the keeper
path, and generated absolute like the shm path already was).
- The unix Payload and EncodedPayload borrow every path and the encoded
string. The supervisor lends its session paths per spawn instead of
cloning boxes. seccomp_payload stays owned until fspy_seccomp_unotify
grows borrowed types.
- fspy_shared is allocator-agnostic: channel(), Receiver, and sender()
are generic over the allocator, and decode_payload_from_env leaks its
allocations into whichever allocator the caller passes, whose
lifetime bounds the payload. The supervisor instantiates with the
global allocator.
- The unix preload attaches with one page-backed bump from
fspy_nostd_alloc::page_bump(), held in ManuallyDrop from the start:
the payload storage lands at its base, the sender's temporary path
decode runs inside Bump::scoped so the same chunk is reused and
reclaimed, and the never-dropped bump gives one mapping for the whole
attach unless the payload outgrows the chunk, nothing from the global
allocator, and no borrows into the mutable process environment.
assume_process_lifetime documents the single unsafe step that names
the leak.
- The Windows preload deserializes its payload zero-copy from the
static page and forwards those original bytes to children instead of
re-serializing per spawn.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments