Repository navigation
Conversation
…e 13.42 does Firmware 13.42's libkernel_sys.sprx returns 0x80020016 from sceKernelLoadStartModule for nonzero flags or a non-null opt, and from sceKernelStopUnloadModule for nonzero flags, a non-null opt or handle 0. Both ignored these arguments. sceKernelLoadStartModuleForSysmodule accepts flags there, so it no longer forwards them. Record that sceKernelStopUnloadModule never runs module_stop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 tasks done
…entry The module info entry went over the 1000-character debt limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sceKernelLoadStartModuleandsceKernelStopUnloadModuleignored theirflagsandoptarguments, andsceKernelStopUnloadModuletreated handle 0 like any unknown handle. Firmware 13.42 refuses these with0x80020016(EINVAL) before it does anything else, and this change does the same:sceKernelLoadStartModule: nonzeroflagsor a non-nulloptreturns0x80020016, andresis left alone.sceKernelStopUnloadModule: nonzeroflags, a non-nulloptor handle 0 returns0x80020016, andresis left alone.sceKernelLoadStartModuleForSysmoduleforwardsflagsas 0. The firmware export adds0x10000toflagsand jumps past the public entry'sflagscheck, so a sysmodule load with flags still loads. A non-nulloptis refused on both paths.Firmware 13.42
system/common/lib/libkernel_sys.sprx(sha2563d361753f6c472cd5442bf92652b4a1dee04051297a0155fe197ede0c2002d4a), read from disassembly, not run on a console:The debt file gains the gap this doesn't close.
sceKernelStopUnloadModulenever runs the module'smodule_stopand stores 0 inres. At0x36657firmware callsmodule_stopwithargsandargpand stores its result inres(0x36663). It skips that call while a count at+0x6cis above 1 (0x364b1–0x36557), which reads like a load count. It returns0x80020010on a path (0x3648d–0x36583) that appears to cover another thread still starting the module. The loader reads only a start entry and initializers from the guest lifecycle metadata (core/libs/prx/libkernel/Module/src/DynamicLoader.cpp:221and:267), with no stop entry, so a follow-up needs the relinker to record one.Tested
caca1e4031:guest_dynamic_loader,guest_kernel_sys_module_internaland the fourguest_deferred_module_*tests pass (6 of 6).core/libs/tests/GuestDynamicLoader.cppload the test system module withflags1 and with anoptblock (refused,resuntouched), then load it, refuse to unload it withflags1, with anoptblock and as handle 0, call into it, and unload it. New rows incore/libs/tests/GuestKernelSysModuleInternal.cppcheck thatsceKernelLoadStartModuleForSysmodulewithflags0x10000still reaches the missing-file error, and that anoptblock is refused.main'score/libs/prx/libkernel/Module/src/Module.cppandcore/libs/prx/libkernel_sys/Export.cppabort (0xc0000409, 2 of 2 failed;guest_dynamic_loaderstops atGuestDynamicLoader.cpp:209, theflagsrow).guest_runtime_lifecycleandguest_dynamic_loader_fixed_base_testsare registered on Linux only, and I didn't run them. Both passflags0 and a nullopt.tools/check_conventions.py --base upstream/mainon the committed headcaca1e4031: all checks pass.5ee657294b, had adebt-lengthwarning (thelibkernel_sys.mdmodule info entry reached 1186 characters). I had run the check before committing, and it reads committed Git objects (CONTRIBUTING.md, "reads pull request Git objects"), so it didn't see the debt change. The second commit moves the sysmoduleflagsnote into its own entry, which fixes it.tools/pr_overlap.py --branch: the code-file overlaps are fix(relinker): match AppContent utility import to provider #13486, feat(libkernel_sys): implement mount, unmount and nmount privilege checks #15037, fix(libkernel_sys): reject a null aio_suspend list and a negative kenv length #15115, feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021, fix(libkernel): provide default arguments block for DT_INIT on Linux #6149, feat(libkernel_sys): implement sceKernelFlock over flock #9097 and feat(libkernel_sys): implement sigqueue #9389. In their diffs only fix(libkernel): provide default arguments block for DT_INIT on Linux #6149 names one of these functions, in a debt line about LinuxDT_INITarguments, and none changes them. The many debt-file overlaps are other entries.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)🤖 Generated with Claude Code