relinker: the SDK SYS_mount stub is not trapped, so two public ps5-payload-dev payloads do not convert #8624
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 javierUDP on 2026-10-20T18:51:12Z.
--trap-sdk-syscall-stubsrecognizes the ps5-payload-dev SDK syscall stubs, and on two of that project's public payloads it traps 233 of them and then stops at one more it does not know: the inlineSYS_mountstub.Where
The payloads are published as ELFs in the ps5-payload-dev releases, so no dump is needed.
ftpsrv-ps5.elf7d4b31c83eae4e056580482a3a074e1db25922efc74ac1e439473b45d71a5938websrv-ps5.elf25501b41887a42789792d1367edd2fc892454bfe6b0b1519bc36456a581f264cOn
main892a4f132, with--windows --skip-sce-module:--trap-sdk-syscall-stubsftpsrv-ps50x60c70x709awebsrv-ps50x27070xae6aelfldr-ps50x2187shsrv-ps50x6c7ftpsrv-ps5-install--macosand the Linux target refuse at the same offsets.The sequence
The bytes before the
syscallat those two offsets are identical in both images:21isSYS_mountin the SDK's owninclude/freebsd/sys/syscall.h. The shape matches the threemman.csequencesIsSdkMmanSyscallStubalready knows, arguments thensyscallthen the carry-flag error path, and it is not the generic stub either, since it does not end insyscall; ret.What this is not
Every other syscall in these images is already handled: 233 of them match
SDK_GENERIC_SYSCALL_STUBand are trapped. This is one sequence short of converting both images.What I am not asking for
Whether
mountbelongs in that list is a design call, not an omission to patch blindly: the technical debt entry says other SDK output stays rejected on purpose, and a payload that mounts a filesystem is further from a title thanmmapandmprotectare. Recognizing it would only let the rest of the image convert, since a trapped syscall becomesUD2and still faults when called.Posting the measurements so the decision has them. If adding a fourth sequence is wanted, I can send it with a test.
Apple M5, macOS 26.4, AppleClang 21.0.0, relinker-only build. AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T19:26:10Z.
I checked the current contract before weighing in:
SyscallScanner.cppdocuments three exact inline sequences from SDKmman.c(syscall 74 and both 477 paths), anddocs/user/USAGE.mddescribes--trap-sdk-syscall-stubsas recognizing mmap/mprotect sequences while rejecting other syscall instructions. Since a trapped call still becomesUD2, addingSYS_mountwould broaden the opt-in beyond its documented memory-management scope and let an image convert even though a called mount still faults. I think keeping this one rejected is consistent with the current debug-only contract; the two payload measurements are useful evidence if maintainers want to broaden that contract deliberately.Imported from boykopovar/AnyPS5. Originally posted by kaiffeetasse on 2026-10-20T23:02:35Z.
Data for the open design question in #8729:
SYS_mountis not the last blocker in either payload.Both payloads also inline
__syscall6fornmount(0x17a) andunmount(0x16), and the scan stops at the next one:Measured locally: recognizing only the mount sequence (the scope of #8729) still fails at 0x70ec on ftpsrv and 0xaebc on websrv, both
FAIL: Forbidden syscall instruction. Recognizing all three converts both payloads with exit 0 (239 and 236 trapped sites).The three wrappers do not share one byte sequence apart from the number: they differ in argument preparation (
mount:movslq %edx,%rdx...mov %rcx,%r10;nmount:mov %esi,%esi...xor %r10d,%r10d;unmount:movslq %esi,%rsi...xor %edx,%edx). So one pattern with only the four-byte number immediate masked cannot cover them; each needs its own sequence, with its number masked so an SDK build that renumbers the call still matches. All three come from__syscall6in ps5-payload-dev/sdklibc/mount.c(7116a650a0).If maintainers extend the opt-in, I have that three-wrapper change ready (scanner, fixture with a different-number case, debt entry, USAGE line) and can open one PR for it, or hand the sequences to #8729 so the two do not overlap. If not, this remains a diagnostic gap and neither payload converts.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by hyvvs on 2026-10-20T23:34:22Z.
@kaiffeetasse Thanks for testing both payloads and offering to share the implementation!
I'd be happy to incorporate the additional patterns and tests into #8729 if the maintainers approve extending the syscall trapping behavior. That way we can avoid overlapping PRs.
I'll keep the PR as a draft until we get a decision.
Imported from boykopovar/AnyPS5. Originally posted by mpratsaki on 2026-10-21T11:06:15Z.
More data for the scope question: four more public ps5-payload-dev payloads stop on the same wrapper, and in these the mount family is the only blocker.
On
main2abfb1beb(Windows 11, WinLibs GCC 15.2.0 r7, relinker-only Release), with and without--trap-sdk-syscall-stubs, for--windowsand the Linux target, each stops withFAIL: Forbidden syscall instructionat itsmountwrapper (mov eax, 0x15, the same bytes as in the issue).objdump -dshows exactly threesyscallinstructions in each image, themount,nmountandunmountwrappers, and no SDKmman.cstubs:launchpad-install.elf5f53da68…afed02plutotv-install.elf278fca81…ba756f4svtplay-install.elf31f2caac…603b56832tv4play-install.elf8e93a551…137fc43eaAll four are installers: the wrappers sit next to
install_app, and their job is to set the app up on the console, so a converted image would most likely reach the trapped calls. A mount-only trap would still stop all four atnmount, as with ftpsrv and websrv.For comparison, from the same releases:
gdbsrv-ps5.elf,klogsrv-ps5.elf, and the websrv bundles EDuke32 and Wolf4SDL (both.elfs) convert only with--trap-sdk-syscall-stubs; LakeSnes, Omnispeak, OpenJazz and PKGInstall convert without it. Conversion only, nothing was run.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by kaiffeetasse on 2026-10-21T11:35:01Z.
Same measurement over the whole public payload catalog, relinker-only build of
maind97361bd0, each asset converted with--trap-sdk-syscall-stubs --skip-sce-module.mountonly (the scope of #8729)mount,nmount,unmount(the__syscall6family)Catalog: every PS5 asset of the current ps5-payload-dev releases - elfldr v0.25/v0.26, ftpsrv v0.21/v0.21.1 (binary and installer), websrv v0.34/v0.35, shsrv v0.19/v0.20, gdbsrv v0.8/v0.9, klogsrv v0.8/v0.9, launchpad v0.1/v0.2, plutotv v0.2/v0.3, svtplay v0.3/v0.4, tv4play v0.2/v0.3. The six other release assets are
-ps4.elfand fail for the same reason; they are out of scope here.With mount only, every failure is the next wrapper of the family: ftpsrv at 0x70ec (v0.21.1) and 0x70fc (v0.21), websrv at 0xaebc and 0xa96c, launchpad at 0x4fc, plutotv at 0x68c, svtplay at 0x50c, tv4play at 0x68c. elfldr, shsrv, gdbsrv and klogsrv contain no mount-family wrapper and convert under either scope.
So if the opt-in is extended, it has to cover the family:
mountonly converts 10 of 22 and leaves both payloads named in this issue failing.AI-assisted: yes