fix(libkernel): answer sceKernelGetModuleInfoFromAddr's flags and failures as measured on a PS5 #10230
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10230"
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 orezraey on 2026-10-23T14:54:20Z.
What
sceKernelGetModuleInfoFromAddrmeasured on a retail PS5 (firmware 13.60) throughlibkernel_sys.sprxfrom a payload process, for flags -1 to 8, system-module, stack, heap, low and null addresses, and several inputst_sizevalues. The sources and console logs are in this gist (pmodinfo,pmodinfo2).libkernel_sys.sprx(id 1),libSceLibcInternal.sprx(id 2)ESRCHEINVALESRCHfor a stack, heap or low address)st_sizeon success, whatever was passed in (0, 0x160, 0x1A8, 0x10000)EFAULTEFAULTFlags 2 now refuses AnyPS5's host libraries, which stand in for the system modules, and still finds the main program and
.guest.prxmodules. Flags 2 finding a title module could not be measured, since a payload process has none. The two internal callers that look up any address, the Linux unwind lookup and the thread-destructor DSO lookup, now pass flags 1.sceKernelInternalMemoryGetModuleSegmentInfoandsceKernelGetLibkernelTextLocationreturned 0 with address and size 0 in the payload process. A title process may differ, so the code is unchanged and the debt entry records it.#8658 and #9263 (macOS) touch the same function and debt lines; whichever lands second keeps both.
Tested
Windows 11, MinGW (winlibs).
guest_module_infochecksEINVALand the cleared buffer for flags -1, 0, 3, 4 and 8, a throw for a null info with flags 0, flags 1 and 2 on a system module's address (found, thenESRCHwith a cleared buffer), flags 2 on the main program, andst_size0. It fails onmainand passes three runs in a row with the change.libkernel_systests pass three runs in a row;guest_kernel_sys_module_internalandguest_force_tls_destructorwere adjusted to pass flags 1 for host addresses.guest_unwind_module_info_failurenow expects flags 1 from the unwind lookup; it fails with the old expectation and passes three runs in a row withguest_module_info,guest_kernel_sys_module_internalandguest_force_tls_destructor.guest_kqueuefails intermittently on this machine with and without the change.tools/check_conventions.pypasses.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)