fix(libkernel_sys): return EFAULT from uuidgen for an unwritable store #13187
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13187"
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-30T05:46:07Z.
What
uuidgen(core/libs/prx/libkernel_sys/Uuid.cpp) directly wrote tostore[index]after only checkingstore == nullptr. Passing an unmapped, invalid, or unwritable pointer like(GuestUuid*)0x10caused a hostSIGSEGVsegmentation fault.GuestCopyOut_nid_no_patch, returningEFAULT(14) on unmapped or unwritable addresses while preserving the state advance, matching FreeBSD 11sys_uuidgen.(GuestUuid*)0x10incore/libs/tests/GuestKernelSysUuid.cpp.docs/dev/debt/libkernel_sys.mdaccordingly.Tested
Arch Linux x86_64, GCC 15.2.1, Release, based on
main42d992b02a:ctest --test-dir build -R '^guest_kernel_sys_uuid$' --repeat until-fail:3 -V: passed (3 of 3 runs).mainbaseline with the new0x10test row,guest_kernel_sys_uuiddeterministically crashed withSIGSEGV(***Exception: SegFault). With this PR, it passes cleanly.python3 tools/check_conventions.py --base upstream/main: passed cleanly.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)