Commit Graph
1406 Commits
Author SHA1 Message Date
rooklz 025435d164 fix(relinker): reject udata8 funcrel unwind pointer overflow 2026-10-31 19:07:45 +01:00
rooklz fd065eece1 test(relinker): pin EH udata2 funcrel overflow via LSDA path 2026-10-31 18:07:47 +01:00
rooklz d2de599520 test(relinker): pin EH udata2 funcrel table overflow 2026-10-31 18:07:41 +01:00
rooklz ffa4075be8 test(relinker): pin EH udata4 funcrel overflow via LSDA path 2026-10-31 13:27:20 +01:00
AdriàandClaude Haiku 5.5 0dba616a91 test(relinker): pin EH uleb128 datarel overflowing LEB128 row
Standalone eh_frame_hdr row after the existing table overflow case:
encoding 0x31 (uleb128 | datarel) with a ten-byte ULEB128 whose last
byte overflows 64 bits, on segments at 0xFFFFFFFFFFFFF000. The reader
must throw "overflowing LEB128 value" from EhFrameReader::leb.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-31 12:48:54 +01:00
Adrià 467673ea69 Merge pull request #13591 from rooklz/test/unwind-uleb128-funcrel-signed-overflow
test(relinker): pin EH table uleb128 funcrel overflow row
2026-10-31 12:21:15 +01:00
Adrià cf5a1805e5 Merge pull request #13520 from rooklz/test/unwind-sdata2-datarel-signed-overflow
test(relinker): pin EH sdata2 datarel signed overflow
2026-10-31 11:20:19 +01:00
rooklz 7aee2b951d test: repair uleb128 funcrel overflow via LSDA path
Replace flawed EH-table case 11 with a standalone CIE zPLR fixture
(LsdaEncoding 0x41) that trips overflowing LEB128 in readFde.
2026-10-31 11:19:33 +01:00
Adrià 049619c202 Merge pull request #13580 from rooklz/test/unwind-sleb128-funcrel-signed-overflow
test(relinker): pin EH sleb128 funcrel signed overflow
2026-10-31 11:12:13 +01:00
Adrià c3c45d73ab Merge pull request #13620 from PolkadotDom/fix/cfg-segment-relative-transfers
fix(relinker): keep segment-relative transfers unresolved in CFG
2026-10-31 10:28:55 +01:00
rooklz 95b392894c test(relinker): pin EH sdata2 datarel signed overflow 2026-10-31 10:20:08 +01:00
rooklz 4313a46db1 test(relinker): pin sleb128 funcrel overflow via LSDA path 2026-10-31 10:16:48 +01:00
rooklz fd154cb422 test(relinker): pin EH sleb128 funcrel signed overflow 2026-10-31 10:16:33 +01:00
rooklz 9473c87181 test(relinker): pin EH sdata8 funcrel signed pointer overflow 2026-10-31 09:10:43 +01:00
AdriàandClaude Haiku 5.5 fe13b4d2df test(relinker): pin EH sdata4 funcrel signed overflow row
Standalone EH table fixture after the unwind record loop: CIE zPLR with
LSDA encoding 0x4B (sdata4 funcrel), FDE augmentation 0xFFFFEFFF with
functionBase at the FDE begin 0x1000. The signed branch of
EhFrameReader::encoded must reject it with "unwind pointer address
overflowed".

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-31 08:15:42 +01:00
rooklz 30eafc1ee3 test(relinker): pin EH sdata8 datarel signed overflow 2026-10-31 07:09:55 +01:00
rooklz 0d9e410b1a test(relinker): pin EH sdata4 datarel signed overflow 2026-10-31 05:12:57 +01:00
AdriàandClaude Haiku 5.5 aa968f07de test(relinker): pin EH table udata4 datarel overflow
Standalone block after the main table overflow case: encoding 0x33
(udata4 + datarel), u32 0xFFFFFFFF displacements at the real table
entry offsets 16 and 20, data base 0xFFFFFFFFFFFFF000 so max - base
is 0xFFF, and an assert on the overflow RelinkerException message.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-10-31 03:41:07 +01:00
rooklz f3b32c8372 test(relinker): isolate EH sleb128 datarel signed overflow pin 2026-10-30 23:26:41 +00:00
rooklz a888cbecab test(relinker): pin EH sleb128 datarel signed overflow 2026-10-30 23:26:41 +00:00
dom 06340c0485 test(relinker): retain ignored prefixes and explicit CFG roots 2026-10-30 15:42:03 -04:00
dom e18bdde237 fix(relinker): keep segment-relative transfers unresolved in CFG 2026-10-30 15:40:18 -04:00
Adrià 4bc9e779aa Merge pull request #13334 from Filip722/refactor/cli-fixed-base-parser-20261030
refactor(relinker): share fixed-base argument parsing
2026-10-30 18:58:38 +01:00
Adrià 62bc07d3f0 Merge pull request #13046 from Nciibi/fix/relinker-address32-wide-store
fix(relinker): split 32-bit absolute wide stores at the displacement boundary
2026-10-30 18:58:21 +01:00
Adrià 556547da71 Merge pull request #13211 from Cool-Coder174/test/macos-loader-test-links
test(relinker): hard-link the shared native libraries of three macOS loader tests
2026-10-30 17:32:55 +01:00
Adrià b1b5353cfc Merge pull request #11413 from atinseau/codex/relinker-island-function-entry
fix(relinker): keep moved instructions off a function entry after padding
2026-10-30 14:48:59 +01:00
AdriàandClaude Sonnet 5.5 f0aac7e014 fix(relinker): treat VEX.X as an index when splitting 32-bit absolute wide stores
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 14:16:42 +01:00
Nciibi 5fc3344955 fix(relinker): restrict 32-bit wide-store splits to absolute operands 2026-10-30 14:16:32 +01:00
Nciibi b6f5abaf9f fix(relinker): split 32-bit absolute wide stores at the displacement boundary 2026-10-30 14:16:32 +01:00
Filip Michalski 88d80bd993 refactor(relinker): share fixed-base argument parsing 2026-10-30 13:58:36 +01:00
Adrià dd2386af42 Merge pull request #13010 from rooklz/fix/windows-tls-eip-relative-moves
fix(relinker): wrap EIP-relative operands moved into Windows TLS stubs
2026-10-30 10:56:03 +01:00
Adrià 2bf9fde0f0 Merge pull request #12554 from dkdhanda8/fix/entry-stub-rel32-wrap
fix(elfpatcher): reject an entry-stub rel32 distance that only fits after a 64-bit wrap
2026-10-30 10:51:50 +01:00
Adrià cfe82f6a2f Merge pull request #10142 from xTRACKGOD/fix/relinker-zero-finalizer
fix(relinker): preserve guest finalizers at address zero
2026-10-30 10:51:42 +01:00
atinseau 96581cb7d6 fix(relinker): keep moved instructions off a function entry after padding
An island or relocation window could start in the int3 or nop padding after a jump or return and run into the next function. A function that only a pointer reaches, such as a virtual method, is not a known branch target, so its first bytes became the middle of a jump to a stub. An instruction that follows a jump, a return, a trap or padding after one of them can now only start a window. An int3 inside a window does not count as such an instruction, so a window that lies entirely in int3 padding is still used, as before; nop padding stays excluded, since a function built with -fpatchable-function-entry can begin with a nop.
2026-10-30 09:58:27 +01:00
Adrià 389563fdf7 Merge pull request #12591 from tablefrogpillow/fix/ptload-congruent-overlap
fix(relinker): accept byte-congruent PT_LOAD overlaps by trimming the earlier segment
2026-10-30 07:41:25 +01:00
IsaacandClaude Opus 5.5 d655c9a908 test(relinker): hard-link the shared native libraries of three macOS loader tests
macOS assesses each new Mach-O file the first time it is executed or
loaded and caches the verdict per file, not per content. The tests wrote
a byte copy of their shared libraries into every case, so every case
paid the assessment again. A hard link reuses the verdict of the file
that was already assessed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 23:23:44 -07:00
Adrià 064c6bb320 Merge pull request #12430 from akkadbakkad89/fix/windows-kernel-family-fallback
fix(relinker): resolve kernel-family exports for libkernel-declared imports
2026-10-30 06:54:36 +01:00
Adrià 47e0293303 Merge pull request #12857 from slopgobblercobbler/fix/relinker-dynamic-hash-bounds
fix(relinker): validate SysV and GNU dynamic symbol hash table bounds
2026-10-30 06:35:58 +01:00
Adrià ee98959b03 Merge pull request #12842 from PolkadotDom/fix/annotate-export-aliases
fix(tools): retain export aliases in module annotations
2026-10-30 05:52:00 +01:00
Adrià 6d56eb813c Merge pull request #12643 from slopgobblercobbler/fix/relinker-relative-jump-tables-address-space-bounds
fix(relinker): validate text section range before scanning relative jump tables
2026-10-30 02:32:29 +01:00
Adrià 886e6d752c Merge pull request #12176 from slopgobblercobbler/fix/relinker-plt-compactor-address-space-bounds
fix(relinker): validate text section range and patch offset bounds in PLT compactor
2026-10-30 02:27:03 +01:00
Adrià b77b0372a4 Merge pull request #12307 from dkdhanda8/fix/linux-patch-unsigned-displacement
fix(elfpatcher): take rel32 displacements as unsigned differences
2026-10-30 02:04:11 +01:00
Adrià 21b9366d1a Merge pull request #9414 from Delciob/fix/relinker-msvc-nominmax
fix(relinker): support MSVC build and prevent NOMINMAX collision on W…
2026-10-30 01:20:37 +01:00
Adrià e7d8e35336 Merge pull request #6204 from vrebel11/fix/windows-entry-stub-rva-boundary
fix(relinker): guard Windows entry-stub RVA allocations
2026-10-30 00:56:57 +01:00
Adrià 992d3fa639 Merge pull request #9589 from DavidSamir/test/win-relinker-fixtures
test(relinker): run the relinker fixture suites on Windows
2026-10-30 00:45:38 +01:00
Adrià 83861d9909 Merge pull request #12068 from dantdmdarealguy/fix/relinker-cli-off-test-registrations
fix(build): skip the core/libs relinker CLI tests when ANYPS5_RELINKER_CLI is OFF
2026-10-30 00:28:20 +01:00
Adrià 8324dbb30a fix(relinker): test earlier bss over non-zero later file bytes and state the protection gap first in the debt entry 2026-10-29 23:24:44 +01:00
tablefrogpillowandClaude Opus 4.8 dbf358ef81 fix(relinker): refuse write-execute PT_LOAD overlaps and bound the congruence check
Addresses the #12591 review. Because the Windows image ORs page permissions,
refuse a congruent overlap when one segment is executable and the other
writable and the later segment does not start on a page boundary, which would
otherwise share a read-write-execute page; the rule is applied on both loaders
so their acceptance decision matches. Bound the congruence check to the
file-backed part of the overlap and compare spans rather than walking the
implicit zero bytes of a large bss overlap.

Expand test_executable_segments.py: byte-congruent tail and bss overlaps
accepted with their trimmed sizes and no output overlap; a write-execute
overlap refused at an unaligned boundary and accepted at an aligned one with
the Windows image carrying no write-execute section; differing bytes, an
overlap past the later end, a non-zero file byte over the later segment's bss,
and a shared start address refused; and a no-overlap control. Keep only the
PPSA ids in the relinker.md note.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-10-29 23:24:38 +01:00
tablefrogpillowandClaude Opus 4.8 d1904e7b66 fix(relinker): accept byte-congruent PT_LOAD overlaps by trimming the earlier segment
Some homebrew toolchains emit an eboot whose read-only PT_LOAD runs over the
GNU_RELRO start of the following read-write PT_LOAD, with byte-identical content
over the overlap. The relinker refused every such title with "Overlapping
PT_LOAD memory ranges" on both the Linux and Windows paths (Photo Splat VR
PPSA99770 #12183, FoxHollow PPSA99573, WWE 13 PPSA92013).

When an earlier PT_LOAD's tail overlaps a later one, the overlapping bytes are
identical, and the overlap does not extend past the later segment, trim the
earlier segment to end where the later one starts so the later segment owns the
shared range. On Linux the preserved PT_GNU_RELRO makes that range read-only
after relocation, matching the earlier read-only mapping; the Windows image
builder has no RELRO step, so the shared range stays writable (noted in
docs/dev/debt/relinker.md).

Overlaps whose bytes differ (the #10564 case), that extend past the later
segment, or that share a start address with it are still refused on every
target; the last case would otherwise trim the earlier segment to zero length.
test_executable_segments.py covers the accepted tail overlap and all three
refused cases.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-10-29 23:24:38 +01:00
rooklz 29fce8e2ac fix(relinker): wrap EIP-relative operands moved into Windows TLS stubs 2026-10-29 21:21:42 +00:00