fix(helper): match dyld inserts by file name#82
Closed
athexweb3 wants to merge 2 commits into
Closed
Conversation
composed and removed match on the slice file name, not the exact path, so a re-arm from a relocated build never doubles our entry and teardown finds our slice after the path moves.
clearInjection removed our slice only when the locator still resolved a path, so a moved or deleted slice left a stale DYLD entry. Remove by the platform's canonical slice name instead; a peer tool's entry is untouched.
Contributor
Author
|
Superseded: the same file-name matching and by-name teardown already landed in #80 and shipped in v1.1.2. Closing. |
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.
What
Ports the SimBLE injection hardening.
DYLD_INSERT_LIBRARIESentries are matched by slice file name, not exact path, and teardown removes our slice by its canonical name rather than a locator-resolved path.Why
A re-arm from a relocated build tree could double our entry, and
clearInjectionskipped cleanup whenever the locator could not resolve a path (a moved or deleted slice), leaving a stale DYLD entry behind. File-name matching fixes both and keeps SimEnclave and a peer tool (SimBLE) coexisting on the shared variable.How
InjectionEnv.composed/removedmatch on the file name via afileNamehelper; a re-arm with a relocated path replaces our entry instead of doubling it.HelperModel.clearInjectiongates on the variable being set and removes bySimPlatform.dylibName, so teardown succeeds even after the slice moves.No change to the fence: the interposer stays a simulator-slice, debug-only binary, and arming still resolves the real path.
Testing
make testgreen: C tests, all four Swift packages (including the newInjectionEnvcases), the fence and its self-test, and mechanism C.Checklist