fix(libkernel): sceKernelSetVirtualRangeName rejects a 32 character name and accepts a length of 0 #16869
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16869"
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 xXPBSXx on 2026-11-07T19:27:22Z.
What
sceKernelSetVirtualRangeNamecut a name of 32 or more characters to 31 and returned 0, and returnedEINVALfor a length of 0. On a PS5 a name of 32 characters returnsSCE_KERNEL_ERROR_ENAMETOOLONG(0x8002003f, errno 63) and the earlier name stays, a name of 31 characters is accepted, and a length of 0 returns 0. This does the same: a name of 32 or more bytes returnsENAMETOOLONGwithout changing the name, and a non-null address with a length of 0 returns 0. A null name (EFAULT) and a null address (EINVAL) are unchanged. The mapping calls that take a name (sceKernelMapNamedDirectMemory,sceKernelMapNamedFlexibleMemory,sceKernelMapNamedSystemFlexibleMemory) still cut a longer name to 31 characters through an internal helper, because what the console does there was not measured. A test pins the three results and the debt entry states the measurement. A title process was not measured.Tested
Measured on a PS5 with firmware 11.60 (
kernel_get_fw_version0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr), on 2026-11-07 at 13:54 UTC. A title process may differ. The calls named a mapped 64 KiB range; the names were read back withsceKernelVirtualQuery.mainbeforesceKernelSetVirtualRangeName(range, 0x10000, name of 31 characters)sceKernelSetVirtualRangeName(range, 0x10000, name of 32 characters)sceKernelSetVirtualRangeName(range, 0, name of 12 characters)On this branch, Linux (WSL, Release) on
main571cab9f71db: with only the test commitguest_memoryfails in 3 of 3 runs, and with the fix it passes in 3 of 3 runs. Nine other tests that name ranges indirectly pass with and without the fix.tools/check_conventions.py --base upstream/mainpasses. The probe source and its raw output are in the first comment. Not tested: Windows, macOS, the CI runner, a title process and any other firmware.Overlap (P2, 2026-11-07, 17:20 UTC list of 1732 open pull requests,
main07c8408713, checked 18:46-18:52 UTC): of the 103 open pull requests that changecore/libs/prx/libkernel/DirectMemory/Export.cpp,core/libs/tests/GuestMemory.cppordocs/dev/debt/libkernel.md, each was merged with and without headee24f1d956d0. None conflicts only with this branch (0 of 103); 42 conflict withmainwithout it as well; the other 61 merge cleanly with and without it.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)AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T22:47:34Z.
Review: COMMENTED
The Windows cell you list as not tested. Head
ee24f1d956merged ontomain302864d48c(clean), Windows 11 x64, WinLibs GCC 15.2.0 r7, Release:guest_memorypasses 3 of 3 runs, so the 31-character name, the 32-characterENAMETOOLONGwith the earlier name kept, and the length-0 success hold on the MinGW build too.main'sguest_memorypasses as well on the same tree.AI-assisted: yes.