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]>
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 7a (Windows) for Linux. Builds the slice 4 interposer cdylib on demand, writes a probe file in a tempdir, spawns `sh -c "cat probe.txt"` with LD_PRELOAD set via slice 6e's `inject_via_env`, captures stderr on a background thread, and asserts that a RPO_HOOK line appears containing the probe path.
Stronger assertion than Windows can make today
The Linux test asserts the specific probe path appears in a RPO_HOOK line — proving the detour fires on a real (non-diagnostic) file-open call. The Windows equivalent (slice 7a/7b) can only assert "some RPO_HOOK line fires" because cmd's `type` builtin doesn't appear to use `kernel32!CreateFileW`. Slice 7c will fix that with a Rust fixture binary that explicitly calls `CreateFileW`.
Verification (docker rust:1.85-slim)
```
$ docker run --rm -v "$PWD:/work" -w /work rust:1.85-slim sh -c
"cargo test -p running-process-observer --features embed-helper --test interposer_integration_linux"
running 1 test
test interposer_so_fires_rpo_hook_via_ld_preload ... ok
test result: ok. 1 passed; 0 failed; 0 ignored
```
Where this leaves #551
🤖 Generated with Claude Code