Repository navigation
fix(relinker): reject a relocation target whose range wraps the address space - #2091
Merged
oneandonlydean merged 1 commit intoOct 10, 2026
Merged
Conversation
Closed
11 tasks
Contributor
|
Windows run, since the description notes it wasn't tested there: Windows 11 Pro 25H2 (10.0.26200.9457), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, full build with
AI-assisted: yes |
…ss space A jump slot whose r_offset is 0xFFFFFFFFFFFFFFF8 or higher makes targetGotOrPltAddress + 8 wrap, so the upper lower_bound lands before the lower one and the call-site loop walks past the end of the map (SIGSEGV; ASan heap-buffer-overflow in ResolveCallSites). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
treuenten
force-pushed
the
fix/relinker-callsite-range-wrap
branch
from
October 10, 2026 03:08
d5d6e57 to
d1c1410
Compare
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 10, 2026
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 10, 2026
SleglJan
pushed a commit
to SleglJan/AnyPS5
that referenced
this pull request
Oct 10, 2026
…te-range-wrap fix(relinker): reject a relocation target whose range wraps the address space
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
CallSiteResolver::ResolveCallSitestakeslower_bound(address)andlower_bound(address + size). For a jump slot whoser_offsetis0xFFFFFFFFFFFFFFF8or higher,address + 8wraps, the upper iterator lands before the lower one, and the loop walks past the end of the map. On main the relinker dies with SIGSEGV (exit 139) in both Linux and--windowsmode instead of failing with an error. Under ASan:The resolver now throws
RelinkerException("Relocation target range exceeds the address space")when the range does not fit, with the samesize > max - begincheck asEhFrameReader.cpp:173andStrictNidFilter.cpp:26.0xFFFFFFFFFFFFFFF7still reaches the existing PT_LOAD containment check.test_jmprel_table_bounds.py: the fixture's jump slotr_offsetbecomes a parameter; targets0xFFFFFFFFFFFFFFF8,0xFFFFFFFFFFFFFFFCand0xFFFFFFFFFFFFFFFFmust exit 2 with the new message and write no output.No open pull request touches
CallSiteResolver.cppor this test.Tested
macOS arm64 (Apple M3), AppleClang 21, relinker-only build:
ctest34/34 in Release, and 34/34 with-fsanitize=address,undefined.python3 tools/check_conventions.py --base origin/mainpasses.Full CI on my fork (run 37943413968), using this repository's
build.ymlunchanged on this PR merged intomaind70b899:jmprel_table_boundspasses on Linux and Windows.rmz-24 also ran the full Windows build with d5d6e57 (510/510).
Rebased onto
mainc963432 on 2026-10-10 with no change to the diff (now d1c1410). Thelinuxandwindowschecks on the old head failed because they built onmain6cc0503, from before #2099 added SPIRV-Headers to the Vulkan test targets. On c963432 both full builds stop at the ctest registration check (agc_driver_recorder_testsis still inKNOWN_UNRUN). The same failure happens onmain's own push build, so it is not caused by this change. After the rebase, the relinker-only ctest passes 49/49 on macOS.Not run: any title.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code