fix(libkernel): accept any block size and a null block in the system software version getters as measured on a PS5 #11025
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11025"
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-25T14:23:44Z.
What
sceKernelGetProsperoSystemSwVersionandsceKernelGetSystemSwVersionmeasured on a retail PS5 (firmware 13.60) with two homebrew probes callinglibkernel.sprxandlibkernel_sys.sprxfrom a payload process (both libraries resolve to the same address). The sources and console logs are in this gist (pswprospero,pswsystem).sceKernelGetProsperoSystemSwVersionreturnedEINVALwithout writing for any leading size other than 0x28. On the console every size returns 0: 0, 0x27, 0x28, 0x29, 0x30, 0x100 and 2^64-1. The size field is left as given, bytes 8 to 0x27 are written (the string and the packed version at 0x24) and nothing from 0x28 onward changes. The size check is gone.A null block returned
EFAULTfrom both functions. On the console both return 0 without a fault and without touchingerrno. Both now return 0 without writing.Already matching, now recorded:
sceKernelGetSystemSwVersionignores the size field on 13.60 too (values 0, 1, 0x18, 0x27 to 0x30, 0x40, 0x1000 and 2^64-1), and still reports "13.590.001" while the Prospero variant reports "13.600.007", as it did on 13.42. The version AnyPS5 reports stays0x01000000("01.000.000"); the console's firmware version is still not modeled.Before and after
| Case | PS5 | AnyPS5 before | AnyPS5 now |
|---|---|---|---|
|
sceKernelGetProsperoSystemSwVersionwith a size other than 0x28 | 0, bytes 8 to 0x27 written |EINVAL, nothing written | 0, bytes 8 to 0x27 written || null block, both functions | 0, no fault |
EFAULT| 0 ||
sceKernelGetSystemSwVersionwith any size | ignores the size | the same | the same || version reported | the console's firmware | "01.000.000" | "01.000.000" (debt) |
Tested
Head
83780cc1a0(main4da123784emerged in, after #9171 landed), Windows 11 Pro 26200, WinLibs GCC 15.2, Release.guest_software_versionchecks a null block (0,errnounchanged) and sizes 0, 0x18, 0x27, 0x28, 0x29, 0x30, 0x100 and 2^64-1: each returns 0, keeps the size, writes "01.000.000" and0x01000000, and leaves 0x40 bytes after the block untouched.guest_system_configurationchecks a null block (0) and sizes 0, 1, 24, 39 to 41, 48, 64, 0x1000 and 2^64-1.Both pass three runs in a row; on the previous code both fail (the null cases expected
EFAULT, and the Prospero sizesEINVAL).At
65172ff414(maina4f0c002damerged in; the only conflict was thedocs/dev/debt/libkernel.mdline next to the newsetloginentry, both kept) both tests pass three runs in a row on Windows and on Linux (WSL build tree, same targets).tools/check_conventions.pypasses.Checklist
Based on current
main; no other open PR implements the same functionsOne topic per PR; follow-ups go in a new PR
No comments in code except technical debt
Unimplemented paths throw (
NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt fileNo notes, investigation
.mdfiles or images added to the repository (attach them to this PR)New third-party code is a submodule built from source
Generic behaviour, not specific to one title
Depends on: none (#9693 landed first; its
setloginentry is kept next to this one since65172ff414)Fixes: none
Unblocks: none
GPUs tested: n/a
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T14:26:17Z.
Review: COMMENTED
The PS5 probe source and logs support the size and null-pointer results claimed here. My local checks passed:
git diff --check,tools/check_conventions.py, and C++20 syntax checks for the changed implementation and test files. The hosted conventions, intake, labels and report checks pass; product build/test jobs are skipped, and I could not run the linked library test locally because the SDL2 submodule and XRandR development support are unavailable.One integration item remains before I can approve: CONTRIBUTING.md says authors should agree the merge order for overlapping files. This PR proposes #9171 first and records it in
Depends on, but I do not yet see confirmation from #9171's author. Please record that agreement; after #9171 lands, refresh this branch while preserving both debt entries.