Repository navigation
fix(libkernel): answer sceKernelGetModuleInfoFromAddr's flags and failures as measured on a PS5 - #10230
Conversation
…lures as measured on a PS5 Flags 1 finds any module and flags 2 only non-system ones; other flags return EINVAL instead of throwing, every failure clears the 0x1A8 bytes, and st_size is left 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
@orezraey Please keep the final checklist value to yes, removing the parenthetical suffix. |
|
The AI-assisted line now reads yes. |
|
@orezraey, a full CI run with this head (run 40072810060) fails one Linux test, This PR changes If flags |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for running it. Flags 1 is the measured lookup for any module (pmodinfo found |
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)