relinker, libkernel: ps5-payload-dev SDK payloads need a loader entry with kernel access (payload_args_t); in scope? #9381
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 rocklouis055 on 2026-10-21T19:49:21Z.
Description
With #9234, an executable built with the ps5-payload-dev SDK links against
libs/on Linux (#9180), but it still cannot start: the SDK's startup code expects to be entered by a PS5 ELF loader with kernel access, not as a process. This is a question of scope, not a proposal: is the SDK payload entry something AnyPS5 should support?What the SDK startup needs
The SDK's
_startreceives apayload_args_t*inrdifrom the ELF loader (crt/payload.h):payload_initin crt/crt.c then runs, in order:__crt_syscall_init(crt/syscall.c): callsargs->sys_dynlib_dlsymforsceKernelDlsymandgetpid, and usesgetpid+0xaas the address of asyscallinstruction.__kernel_init(crt/kernel.c): requires the kernel read/write descriptorsrwpipe/rwpair,kpipe_addrandkdata_base_addr, and derives kernel addresses from them per firmware version.__patch_init(crt/patch.c): patches the process credentials and the syscall permissions in kernel memory.__rtld_initand__rtld_lib_open: the SDK's own runtime linker, which reads the kernel's loaded-module objects withkernel_copyout(crt/rtld_sprx.c).So supplying
payload_args_twould need more than asys_dynlib_dlsym: steps 2 to 4 read and write kernel memory.Observed
Linux x86-64 (Ubuntu 26.04, GCC 15), Release, full
libsofmain7280a17ec, relinker from #9234 atbe51ab7,--to-intel --skip-sce-module --trap-sdk-syscall-stubs.samples/hello_world(v0.44, sha2566fef85336910398c242baa1f0bae1bc2c318d4dc5da52817375d8a8defc75d5e)0x1from+0x463in__crt_syscall_init10ccd3ed1253cb92eb0fed3c93af3c474caef2a2e27267b7b6b7980d2fe9693f)0x1Run as a process,
rdiholds1at entry, which the startup dereferences aspayload_args_t.Not covered
Homebrew built as a title instead of a payload, such as the ps5link-sdk examples, imports by NID through the SCE dynamic tables and does not use this entry. Its
gpu_cubeexample runs to its end on the same build.Found with AI assistance (Claude Code); the commands and outputs above were run locally.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T22:42:13Z.
For the scope decision, I recommend keeping direct
ps5-payload-devpayload startup out of scope unless a future design can support its kernel-dependent startup without granting or emulating kernel read/write access. The issue tracespayload_initbeyond argument delivery into credential and syscall patching plus kernel-backed module lookup, so synthesizingpayload_args_talone would not make these payloads safe or functional. The existing--trap-sdk-syscall-stubsoption is explicitly a debugging aid and traps if a wrapper executes; it is not a payload runtime. The issue also separates title-built homebrew that uses SCE imports, which remains testable through the normal path. If maintainers agree, documenting this boundary and closing as out of scope seems clearer than implementing a partial loader.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:17:32Z.
The issue’s trace shows payload startup immediately proceeds from
payload_args_tinto kernel read/write descriptor use, credential/syscall patching and kernel-backed module lookup. A loader entry alone would not make this payload model safe or complete. The title-built homebrew path is explicitly distinct and already works through normal SCE imports. I recommend treating directps5-payload-devpayload startup as out of scope unless maintainers want a separately designed kernel model; no implementation PR appears justified by the current evidence.Imported from boykopovar/AnyPS5. Originally posted by rocklouis055 on 2026-10-22T06:15:03Z.
Agreed, thanks @MarcZX10. I have no use case that needs the payload entry; title-built homebrew covers my testing. Happy for this to be closed as out of scope, or kept open only if maintainers want the boundary documented first.