Repository navigation
Conversation
…copy, as a PS5 does sysarch threw for any non-null XFPUSTATE argument (operations 11 and 132). On a PS5 (firmware 12.70) operation 132 rejected lengths 1024 to 8192 with EINVAL and null arguments and addresses with EFAULT, and accepted 0 to 512. Following FreeBSD 11.4's order (copy the arguments in, compare the length unsigned, copy the state out), an unreadable argument now gives EFAULT, a length from 1024 EINVAL, length 0 returns 0 without copying, and a null address with a length up to 512 gives EFAULT. Lengths 513 to 1023, whose limit was not measured, and copying out the live state still throw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
What
sysarchthrew for any non-null XFPUSTATE argument (operations 11 and 132). On a PS5 (firmware 12.70) operation 132 rejected lengths 1024 to 8192 withEINVALand null arguments and addresses withEFAULT, and accepted lengths 0, 64, 128, 256 and 512 (thesysarchentry indocs/dev/debt/libkernel.md).Following FreeBSD 11.4's order (copy the arguments in, compare the length unsigned, copy the state out):
EFAULT, including one whose last bytes are unreadable: operation 11 copies in 8 bytes and 132 copies in 16;EINVAL;EFAULT.Lengths 513 to 1023, whose limit was not measured, and copying out the live state still throw.
GuestSysarch.cppcovers both operations; the pendingsysarchdebt fragment from boykopovar#22039 is updated here, as both change the same entry. It keeps the 13.60 LDT wording that 1364845 added.Tested
Linux (Debian 13, GCC 14.2.0, Release). Head
3d354f3678, rebased ontomain11c9e7764ewithout conflicts. The runs after the first two bullets are from earlier heads.3d354f3678, merged with fix(libkernel): report is_committed from sceKernelVirtualQuery only for direct memory, as a PS5 does boykopovar/AnyPS5#22013 and fix(libSceNpUniversalDataSystem): fail the event and property calls before Initialize, as the 13.42 module does boykopovar/AnyPS5#22049 ontomain11c9e7764e:ctest -R '^(guest_sysarch|guest_memory|guest_mmap_fixed_anonymous|guest_virtual_query_arguments|np_uds_events|guest_np_uds_.*|guest_np_trophy_.*)$': 16 passed, andguest_mmap_executableskipped itself (exit 77) in this environment. This head adds Helldiverr's three pins: an unreadable argument (0x10) for both operations, length 512 with a null address, and an argument at the end of a readable page.guest_sysarch: operation 132 copying in 12 bytes instead of 16;EINVALinstead ofEFAULTfor an unreadable argument, for each operation; throwing from length 512.ctest -R '^guest_sysarch$': passed.Process.cppand this branch's test,guest_sysarchaborts at the first XFPUSTATE length check, which throws there.ctest(5896 tests,-j 12) with this branch and my other twelve branches of this round merged ontomain521fb7fec4: 5880 passed. The 16 failures are the set that fails onmainin the same environment: sixagc_drivercases (agc_driver_image_table_packed_guardspasses when run on its own) and ten that need a.gitdirectory, network or a passwd entry for the user.python3 tools/check_conventions.py --base origin/main: passed.python3 tools/pr_overlap.py --branchat3d354f3678: no conflicting pull request. feat(libs): mirror libkernel exports through libkernel_sys boykopovar/AnyPS5#18190, which conflicts withmain, sharesProcess.cppand could not be compared; it renames exports and does not changesysarch's XFPUSTATE handling.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)Summary by CodeRabbit