fix(relinker): keep syscall blocks outside embedded data masks #11565
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11565"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Mherberts on 2026-10-26T20:27:38Z.
What
A LEA-referenced data table followed by a syscall block, padding and another code block could be masked through the later padding boundary, hiding the earlier syscall from executable and bundled-module validation. Keep the padding-derived upper bound, then shorten it to an earlier syscall-containing block recognized by the existing gap analysis.
Updated with main
c3a5290c7d, retaining the corrected fixture byte (0x55, not the REX prefix0x44) requested in the reviews. This also incorporates main's wrapped-declaration class split and #15526's split ofguest_none_relocationsinto plain/SCE runs. The latter addresses the 20 s timeout seen twice on the preceding macOS x86-64 checks without raising the timeout or reducing coverage. The syscall-boundary change and its regression fixtures remain unchanged by this integration.Tested
Head
827267128c, Windows x64, MinGW GCC 13.2.0, Python 3.13.15, Ninja Release,ANYPS5_RELINKER_ONLY=ON,BUILD_TESTING=ON.control_flow_graph, both embedded-syscall conversion tests, both plain/SCE guest-relocation groups and all 16 wrapped-declaration/ABI-alias cases. The two guest-relocation groups took 2.72 s and 3.06 s on this Windows host.42432069c7completed 670/671 tests;guest_none_relocationsalone timed out. The current integration includes the upstream fix for that test (#15526).upstream/mainandgit diff --check upstream/main...HEADpassed. The required comparison with the fork's outdatedorigin/mainalso ran and reports six unrelated upstream commit-subject errors and existing debt-length warnings.Current-head CI audit on 2026-11-05: Build run 41923925977 passed all four relinker configurations (Linux, Windows, macOS arm64 and macOS x86-64) and relinker ASan on
827267128c5b2b7ab9d104b6aef133b1028d1c82. Conventions and labels also passed. Full product jobs were skipped by workflow policy. The fixture already uses0x55, and the requested main integration is included. No retail title or GPU testing.Current overlap audit, 2026-11-05: manually inspected newly listed base-conflicting #6149 (module-args test source), #13486 (zero-finalizer test/stub-window safety) and #15245 (executable-export test registration). Their CMake edits do not implement or modify this syscall-mask boundary fix. No source update was needed for those notices.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T22:26:00Z.
Review: APPROVED
Reviewed exact head
6ceab4098a3f2ee85987d10accdea78d19026278; no actionable findings.FindEmbeddedDataTableEndnow preserves the padding-derived upper bound and checks earlier trailing-code blocks for a syscall before returning it. The native cases cover syscall instruction forms, prefixes, padding bytes and optional leading padding; the conversion fixtures exercise both executable and guest-module paths across Linux, Windows and macOS outputs, with non-syscall controls. The author reports the focused native/Python tests and complete relinker-only build passed; hosted eligibility, conventions, intake, labels, all relinker platforms and ASan pass. I did not rerun the tests locally.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T19:01:59Z.
Review: COMMENTED
Follow-up on the
mainmerge failure that JJenkx bisected to #10537. Checked on Linux x86-64 (Ubuntu 26.04, GCC 15.2, Release,BUILD_TESTING=ON): head6ceab4098a3f, merged ontomain4570612f40.embedded_data_syscallstests fail 3/3 on the merge and pass 3/3 on the head alone.09919b040d(#10537).The cause is the test fixture, not the
RelativeJumpTables.cppchange.tail()writes0f 78 11 22 33 44immediately before the routine31 c0 b0 3b 0f 05.ActivePrefixesBeforetreats that trailing0x44as a REX.R prefix of the31 c0. That is how a CPU decodes it:44 31 c0isxor eax, r8d, which does not zeroeax.ConstantRaxSetEndingAttherefore no longer derives syscall number 59 fromxor eax,eax; mov al,0x3b.Skipped 1 syscall byte pattern(s) without a syscall number ...) instead of failing withForbidden syscall instruction.One-byte fix, verified on the merge:
RelativeJumpTables.cppreverted tomain's version, both tests still fail (sysv-syscall-00-linuxandsyscall-00-linuxexit 0). The test still catches the masking bug after the change.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.