libkernel: system version queries fault on invalid memory pointers #13548

Closed
opened 2026-10-30 18:02:22 +00:00 by pushkarreddyy · 0 comments
pushkarreddyy commented 2026-10-30 18:02:22 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-30T18:02:22Z.


Describe the bug

In core/libs/prx/libkernel/System/src/SystemConfiguration.cpp, sceKernelGetSystemSwVersion_nid_postfix, sceKernelGetSystemExVersion, sysKernelGetLowerLimitSysexVersion_nid_postfix, and sysKernelGetLowerLimitUpdVersion_nid_postfix directly dereference caller-provided guest memory pointers. Passing an unmapped or unwritable pointer causes an unhandled host segmentation fault (SIGSEGV) instead of returning SCE_KERNEL_ERROR_EFAULT (or 14).

Reproduction

Call sysKernelGetLowerLimitUpdVersion_nid_postfix(reinterpret_cast<std::uint32_t*>(0x10)). The host terminates immediately with SIGSEGV.

Expected behavior

Invalid memory pointers should be validated using GuestCopyOut_nid_no_patch / GuestCopyIn_nid_no_patch and return SCE_KERNEL_ERROR_EFAULT (or 14).

I am implementing this fix along with test coverage in core/libs/tests/GuestSystemConfiguration.cpp and will open a PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6124395667 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/13548). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-30T18:02:22Z. --- ### Describe the bug In `core/libs/prx/libkernel/System/src/SystemConfiguration.cpp`, `sceKernelGetSystemSwVersion_nid_postfix`, `sceKernelGetSystemExVersion`, `sysKernelGetLowerLimitSysexVersion_nid_postfix`, and `sysKernelGetLowerLimitUpdVersion_nid_postfix` directly dereference caller-provided guest memory pointers. Passing an unmapped or unwritable pointer causes an unhandled host segmentation fault (`SIGSEGV`) instead of returning `SCE_KERNEL_ERROR_EFAULT` (or `14`). ### Reproduction Call `sysKernelGetLowerLimitUpdVersion_nid_postfix(reinterpret_cast<std::uint32_t*>(0x10))`. The host terminates immediately with `SIGSEGV`. ### Expected behavior Invalid memory pointers should be validated using `GuestCopyOut_nid_no_patch` / `GuestCopyIn_nid_no_patch` and return `SCE_KERNEL_ERROR_EFAULT` (or `14`). I am implementing this fix along with test coverage in `core/libs/tests/GuestSystemConfiguration.cpp` and will open a PR.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#13548
No description provided.