Repository navigation
Conversation
Mirror of slice 7a (Windows) but driven by LD_PRELOAD instead of CreateRemoteThread. Linux doesn't need an injection vehicle: the dynamic linker reads the env var at process startup and loads the interposer .so before main(), so the slice 4 symbol shadows (open/openat/close/write/unlink/rename) are in effect for every libc call from the spawned process and its descendants. Test scenario: - Build the slice 4 interposer cdylib on demand via cargo. - Write a probe file in a tempdir. - Spawn `sh -c "cat probe.txt"` with LD_PRELOAD set to the interposer via slice 6e's inject_via_env(). - Capture child stderr on a background thread. - Assert a RPO_HOOK line appears AND contains the probe path — stronger assertion than slice 7a/7b's Windows version (which can only assert "some RPO_HOOK fires", pending slice 7c's investigation of why cmd's `type` doesn't go through kernel32!CreateFileW). Verified in docker rust:1.85-slim: test interposer_so_fires_rpo_hook_via_ld_preload ... ok test result: ok. 1 passed; 0 failed; 0 ignored. Closes the Linux half of the slice 7 acceptance criterion. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…#551) Mirror of slice 7d (Linux) for macOS. Same shape — the dynamic linker (dyld) reads DYLD_INSERT_LIBRARIES at process startup and loads the slice 5 interposer dylib before main(), so the open/openat/close/write/unlink/unlinkat/rename/renameat shadows are in effect for every libc call from the spawned process and descendants. Test scenario: - Build the slice 5 interposer dylib on demand via cargo. - Write a probe file in a tempdir. - Spawn `/bin/cat probe.txt` with DYLD_INSERT_LIBRARIES set via slice 6e's inject_via_env(). - Capture child stderr on a background thread. - Assert a RPO_HOOK line with the probe path appears. SIP / hardened-runtime caveat: macOS refuses to honor DYLD_INSERT_LIBRARIES against library-validated binaries — includes most system binaries on recent macOS. When that happens, the test gracefully skips the detour assertion and logs the captured stderr for diagnosis. Matches the snapshot tier's posture from #539 (the boundary is "binaries the user owns AND library validation isn't enforced for"). Compile-checked on Windows host (cfg-gated to macOS). Runtime verification will happen on CI when this lands. Closes the macOS half of the slice 7 acceptance criterion. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Jun 22, 2026
Merged
Merged
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.
Summary
Mirror of slice 7d (Linux) for macOS. Builds the slice 5 interposer dylib on demand, writes a probe file in a tempdir, spawns `/bin/cat probe.txt` with DYLD_INSERT_LIBRARIES set via slice 6e's `inject_via_env`, captures stderr on a background thread, asserts that a RPO_HOOK line with the probe path appears.
SIP / hardened-runtime caveat
macOS refuses DYLD_INSERT_LIBRARIES against library-validated binaries — includes most system binaries on recent macOS. When this happens (no RPO_HOOK lines at all), the test gracefully skips the detour assertion and logs the captured stderr. Matches the snapshot tier's posture from #539: the boundary is "binaries the user owns and library validation isn't enforced for."
Verification
Where this leaves #551
With #568 + this PR landed, all three tier-1 platforms have at least one end-to-end integration test exercising the inject + detour pipeline.
🤖 Generated with Claude Code