Repository navigation
fix(relinker): name --trap-sdk-syscall-stubs when a refused syscall is an SDK stub - #9549
Conversation
…s an SDK stub A title whose binary carries the ps5-payload-dev syscall stubs, such as PPSA99061 and PPSA99186, was refused with 'Forbidden syscall instruction at code offset 0x...' and no way to know that --trap-sdk-syscall-stubs converts it. The scanner already knows which sequences that option would trap, so it now appends that to the message only when the refused instruction is one of them. Every other syscall keeps the message it had.
The numbered and the generic SDK stubs are refused with the hint, and the seven bare syscall shapes of the scanner tests are refused without it.
MarcZX10
left a comment
There was a problem hiding this comment.
The message change and negative-control coverage are narrowly scoped and the PR is based on current main. I manually inspected the two reported overlap candidates. #8042 changes only the scanner construction/resynchronization option earlier in SyscallScanner.cpp; it is separate from this PR’s SDK-stub classification and message hunk, so I found no ordering requirement there.
#8729 does change the same trap-condition line and renames IsSdkMmanSyscallStub to IsSdkInlineSyscallStub. This branch still calls the old name. If #8729 lands first, this PR will need that call updated; the checklist currently says Depends on: none, and I found no landing-order agreement in the PR discussion. Please coordinate with @hyvvs on which change lands first, update the Depends on entry to reflect that agreement, then rebase/recheck the combined line. The current hosted relinker matrix is still running on Windows; Ubuntu, macOS x86_64/arm64 and ASAN have passed so far, while platform product-build jobs are skipped.
MarcZX10
left a comment
There was a problem hiding this comment.
Thanks for adding the same-line overlap explanation and recording that the second branch needs a small adaptation. The live overlap check still reports #8729 on the exact syscall predicate line. This branch continues to call IsSdkMmanSyscallStub, while #8729 renames it to IsSdkInlineSyscallStub; the checklist still says Depends on: none, and I do not see an agreed landing order in the discussion.
Please coordinate the order with #8729's author, record the required predecessor on Depends on if one must land first, then rebase/update the helper call and rerun the relinker matrix. The hosted Ubuntu, both macOS architectures and ASAN jobs pass; the hosted Windows relinker job is still running. Product Linux/Windows jobs are skipped. The PR's reported Linux and Windows focused tests are author-reported; I did not run local tests.
The #8042 shared-file result remains a non-blocker: its scanner-construction change is separate from this classification/message hunk. This request is limited to the unresolved #8729 same-line integration rule.
|
The latest update keeps the accurate same-line overlap description, but the code still calls the old helper and the checklist still says |
|
@MarcZX10 thanks. I have asked @hyvvs on #8729 about the order. Their PR is a draft that its author is holding for a decision on If they would rather land first, I will rebase this branch onto #8729, call |
|
The #8729 ordering is now settled: its author agrees this PR lands first, then #8729 rebases and adapts the helper call. |
MarcZX10
left a comment
There was a problem hiding this comment.
The scanner message and negative-control test look sound. I built the PR snapshot with ANYPS5_RELINKER_ONLY=ON, built the relinker and scanner test target, and ran ctest -R ^syscall_scanner$: 1/1 passed. The #8729 author has now agreed this PR lands first, so the prior overlap blocker is resolved and Depends on: none is accurate. I am retaining changes requested only because this branch is 2 ahead/116 behind current upstream/main 4777cac (merge base 94fbb8c). Please update to current main and rerun the focused tests and relinker matrix. Conventions, diff-check and merge-tree pass on the current head; hosted product jobs are skipped.
|
I have a local SDK-stub matcher fix that requires the candidate to start at a decoded instruction boundary and keeps its suffix within the scanned code range. It touches the matcher calls changed here, but addresses a different bug. Would landing this PR first, then adapting the follow-up to pass the additional bounds through your shared |
|
Follow-up on the overlap report for #10792: the overlap check marks this PR and #10792/#10479 on the same |
|
Merge-order follow-up from the current overlap discussion: #10479 is proposed first, this PR second, and #10792 third; #10792’s author agreed and now lists both predecessors. The #10479 author’s earlier note also says #9549 should depend on #10479. Could you confirm that order and, if agreed, update this checklist to |
adriadam10
left a comment
There was a problem hiding this comment.
MarcZX10's CHANGES_REQUESTED (2026-10-22, on this head) is still open, and the queue will not merge past it:
- Merge order: #10479 is proposed first, this PR second and #10792 third (MarcZX10, 2026-10-25; #10792's author agreed and lists both predecessors). plexerPK proposed this PR first on 2026-10-24. Please confirm one order with the #10479 author. If #10479 goes first, set
Depends on: #10479; if this PR goes first, say so in the thread so the other two lists match. The code needs no change either way: whichever lands later adapts thesdkStubexpression. - Freshness: the branch is 3939 commits behind
main. Rebase it and rerunsyscall_scannerand the relinker matrix; the scanner paths themselves have no intervening change.
The change itself (sdkStub hoisting, hint text, RequireHint failing without the change) is fine; once the order is recorded and the branch is current this is a merge.
|
@plexerPK I read your SDK matcher boundary/range proposal above. A fresh review of #10861 composed with #10792 ( |
|
Static review plus an independent Linux run (CachyOS, kernel 7.2.10, GCC 16.2.1, Ninja, Release, What I checked (static)
Focused test run
Note on run history (same class as #7985/#8912/#6146): my first pass reported Not covered This change affects only the human-readable refusal text for one class of syscalls (the trap path and the broad refused-syscall path are unchanged). No paired Vulkan-execution run is required for a relinker/diagnostics-only fix; the focused |
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release.
The same test passes on AI-assisted: yes. |
Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Rechecked on current |
What
A converted title that carries the ps5-payload-dev SDK syscall stubs is refused with
Forbidden syscall instruction at code offset 0x..., and nothing in the message says that--trap-sdk-syscall-stubsconverts it. The scanner already has the matchers for the sequences that option traps, so when the refused instruction is one of them the message now ends with; it is a ps5-payload-dev SDK syscall stub, which --trap-sdk-syscall-stubs replaces with UD2. Any other syscall keeps the message it had, so a real syscall never suggests the flag.Titles whose refusal now names the flag (catalog, Linux relinker,
--to-intel, no trap option):Forbidden syscall instruction at code offset 0xdeb8f7; it is a ps5-payload-dev SDK syscall stub, ...... at code offset 0x214385a: syscall number 9; it is a ps5-payload-dev SDK syscall stub, ...0x1108bf7), PPSA99203 (0x10a2d37), PPSA99360 (0x1699f07) and PPSA99288 (0x24a67ba) show the hint in the same way; the other titles of that list are not re-run here.Spot5 and ForgeNX convert and run for 60 s once
--trap-sdk-syscall-stubsis given (Linux, same harness as the other sweeps): first frame, no stderr.The change is in
SyscallScanner.cpp: the SDK-stub test that decided whether to trap is evaluated once intosdkStuband used for both the trap and the hint. Nothing else in the conversion changes.Tested
syscall_scanner(Linux;SyscallScannerTests.cpp, registered on Linux only): the numbered and the generic SDK stubs are refused with the hint, and the seven bare syscall shapes of the existing tests (unsigned constant, register,int 0x80,sysenter,sysret, clobbered, prefixed) are refused without it. The existing prefix andsyscall number Nchecks are unchanged and pass.SyscallScanner.cppfrom before the change and the same test,syscall_scannerfails withRelinker did not name --trap-sdk-syscall-stubs for the numbered SDK stub. With the change it passes.syscall_scanner,syscall_number,sdk_mman_syscall,conversion_diagnostics,executable_segmentsandsce_code_gapspass, 6 of 6.syscall_scanneritself is not registered on Windows).python tools/check_conventions.py --base origin/mainpasses.git merge-tree: clean againstmain. fix(relinker): trap inline SDK mount syscall #8729 renamesIsSdkMmanSyscallStubtoIsSdkInlineSyscallStuband edits the trap condition, so it conflicts with this change on that line; whichever merges second only needs the function name inconst bool sdkStub = ...brought up to date.python tools/pr_overlap.py --branch fix/relinker-name-trap-flag(the version from fix(tools): merge only the pull requests that share files or exports with the branch in pr_overlap #9539, which merges only the pull requests that share files with the branch; 1 min 18 s): fix(relinker): trap inline SDK mount syscall #8729 conflicts onSyscallScanner.cppL293-294, the trap condition this change turns intosdkStub, and fix(relinker): resync the syscall scan past undecodable data regions #8042 could not be compared because it conflicts withmainitself. Nothing else overlaps.Not run on macOS.
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)