kernel: implement libkernel_module_info module enumeration #2288
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2288
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2288"
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?
@saironbusatto on GitHub · 2026-11-15 15:56 UTC · original
saironbusatto:fix/ea-module-info→main· +115 −0 · 3 files · 1 commits · openGame and problem
EA SPORTS UFC 6 (PPSA23566) and Madden NFL 26 (PPSA26127) call the libkernel_module_info library at startup. Kyty does not register that library, so the calls land on the unresolved-import stub, which returns zero. On Madden NFL 26 the game then keeps calling the stub repeatedly while frozen on the startup screen (Madden compat report, #1834); on UFC 6 the boot still proceeds.
While testing a local build, implementing
sceKernelGetModuleList2made UFC 6 immediately callsceKernelGetModuleInfo2with the returned handle — both were unresolved stubs before, which confirms both are on the startup path oflibkernel_module_info_v1/libkernel_v1.1.Cause
The two functions libkernel.sprx exports through the
libkernel_module_infolibrary are not implemented:sceKernelGetModuleList2(ZzzC3ZGVAkc) andsceKernelGetModuleInfo2(QgsKEUfkqMA).Fix
Implement both over RuntimeLinker's loaded programs:
sceKernelGetModuleList2fills the handle array from a new smallRuntimeLinker::GetProgramIds()accessor, returnsKERNEL_ERROR_ENOMEMwhen the loaded-program list does not fitnum_array, and writes the loaded count toout_count.sceKernelGetModuleInfo2validatesinfo->st_size(0x160 bytes), resolves the program by handle, and fills the PS5ModuleInfolayout — name (so_name with a filename fallback, as inKernelGetModuleInfoForUnwind), up to fourPT_LOADsegments with address/size/prot,segment_count, and a zeroed fingerprint. The layout is cross-checked against AnyPS5'sSceTypes.hpp(static_asserts at 0x8/0x108/0x148/0x14C, size 0x160).Signatures follow shadPS4's
process.cpp(sceKernelGetModuleList2(s32* handles, u64 num_array, u64* out_count),sceKernelGetModuleInfo2(s32 handle, info*)).Result
UFC 6 (PPSA23566) on Linux now boots with zero unresolved-import lines and reaches the menu. Tested on the same build with and without the change: before,
Unresolved import stub called: ZzzC3ZGVAkc[libkernel_module_info_v1][libkernel_v1.1][Func]and, once the list function was added,QgsKEUfkqMA[...]too; after, none.@coderabbitai[bot] on GitHub · 2026-11-15 16:02 UTC · original
Walkthrough
The change adds a
RuntimeLinkermethod that returns loaded program IDs. It adds and registers libkernel functions to list module IDs and retrieve module names and load-segment details. The functions validate output pointers and structure size, and return errors for invalid inputs or unresolved module data.Suggested reviewers:
nmzik,ew-sudoChange: Feature
Merge Risk:
Low · up to
ff152This adds module-enumeration functions that EA titles call at startup. The author reports that UFC 6 reaches the menu with no unresolved imports. A narrow race remains if a module is unloaded while its info is being read. This is unlikely during normal startup. Fixing it is a small change and should be considered, but it does not look like a blocker.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the main change: implementing the libkernel_module_info module enumeration functions. The raw summary shows the new sceKernelGetModuleList2 and sceKernelGetModuleInfo2 implementations, which match this title. The title is short and specific.
Full details: Description check
Explanation
The description explains the game and the startup problem, the cause (two unimplemented functions in libkernel_module_info), the fix (implementations over RuntimeLinker programs, plus a new GetProgramIds accessor), and the test result. It matches the changeset in libKernel.cpp and runtimeLinker files.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
@ -1821,0 +1873,4 @@}auto* rt = Common::Singleton<Loader::RuntimeLinker>::Instance();auto* program = rt->FindProgramById(handle);@coderabbitai[bot] on GitHub · 2026-11-15 16:02 UTC · original
Keep the loaded program alive while
KernelGetModuleInfo2reads it.FindProgramByIdreleasesm_mutexbefore it returns theProgram*. A concurrentUnloadProgramcan then remove the program and free it throughDeleteProgramwhile this function still holds the pointer. The reads at lines 1877-1909 can then access freed memory.Read the required fields while the runtime linker lock is held. One way is a
RuntimeLinkermethod that fills a caller-provided snapshot underm_mutex. Another way is a lookup that returns the needed values rather than the raw pointer.@coderabbitai[bot] on GitHub · 2026-11-15 16:02 UTC · original · reviewed
Actionable comments posted: 1
27e48076-79fe-4929-920d-793f6b53931eReviewing files that changed from the base of the PR and between
3acafb358fandff1529b634.src/libs/libKernel.cppsrc/loader/runtimeLinker.cppsrc/loader/runtimeLinker.hIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.