fix(libkernel): return EFAULT from sceKernelGetAllowedSdkVersionOnSystem for an unwritable store #13790
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13790"
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 DeveshB-1 on 2026-10-31T06:37:10Z.
What
Safely copy the allowed SDK version in
sceKernelGetAllowedSdkVersionOnSystemusingGuestCopyOut_nid_no_patchso that unwritable output pointers returnSCE_KERNEL_ERROR_EFAULT(0x8002000e) without clobberingerrnoinstead of crashing the host process withSIGSEGV.Tested
Linux x86_64 (AMD Ryzen 7 7730U):
guest_software_versionpasses 3 of 3 (ctest --test-dir build -R '^guest_software_version$' --repeat until-fail:3 -V).main, passing an unwritable pointer tosceKernelGetAllowedSdkVersionOnSystemcrashes deterministically withSIGSEGV(***Exception: SegFault 0.08 sec). With this fix applied, it safely returnsSCE_KERNEL_ERROR_EFAULT(0x8002000e) and preserveserrno.python3 tools/check_conventions.py --base origin/mainreports zero findings.python3 tools/pr_overlap.py --branch fix/allowed-sdk-version-efaultreports no conflicting open pull requests implementing the same functions.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T07:02:56Z.
Review: APPROVED
Reviewed — looks good
I found no blocking issue in head
ade08a31e19a80756036acb509f1ef64b8e68053; the function uses the checked guest-memory copy and preserveserrnoon the failure path.What I ran
Reviewed head
ade08a31e19a80756036acb509f1ef64b8e68053against PR base snapshot833be4af8ddcf695bfabc6f8110fb42b4e15e6c7. The merge preview against currentmainde83e8f27015b91327029755f1ea5b60b74d940bwas clean. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No local build or CTest.Results
core/libs/prx/libkernel/CMakeLists.txtregistersguest_software_version.git merge-treereturnedf8be2a6a0570ad752654a95c2271e99d63b5ae1f.SoftwareVersion.cpp; its test-selection step skippedguest_software_version. Linux and specialized jobs were skipped.guest_software_versionpassing 3/3 and the test failing against unmodifiedmain. The tested SHA is not stated; I did not independently run these tests.Unedited output from checks
Precheck conventions output:
ABI audit output:
Test-quality output:
Isolated-checkout helper errors:
Merge preview output:
Windows build and test-selection log excerpts:
Not verified
No local build or CTest and no PS5 console behavior were verified. The author-reported Linux tests were not independently reproduced; hosted Windows did not run the focused test.