libSceRtc: current tick and clock getters fault on unwritable pointers instead of returning INVALID_POINTER #13955

Closed
opened 2026-10-31 13:53:11 +00:00 by pushkarreddyy · 0 comments
pushkarreddyy commented 2026-10-31 13:53:11 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-31T13:53:11Z.


What happens

sceRtcGetCurrentTick, sceRtcGetCurrentNetworkTick, sceRtcGetCurrentClock, sceRtcGetCurrentClockLocalTime, and sceRtcSetCurrentTick (core/libs/prx/libSceRtc/Export.cpp) crash the host process with SIGSEGV when passed an invalid or unwritable guest memory pointer (such as reinterpret_cast<RtcTick*>(0x10)).

In AnyPS5, these functions check for nullptr and return SCE_RTC_ERROR_INVALID_POINTER (0x80B50002), but perform direct memory dereferences without verifying writability or readability via GuestCopyOut_nid_no_patch / GuestCopyIn_nid_no_patch.

Title, test or build step

core/libs/tests/GuestRtc.cpp

AnyPS5 commit

origin/main at 828ac0b2ae

System

Windows 11 / Linux x86_64, GCC 15.2.0, Release

Steps to reproduce

Call sceRtcGetCurrentTick(reinterpret_cast<RtcTick*>(0x10)) or sceRtcSetCurrentTick(reinterpret_cast<const RtcTick*>(0x10)).

Log

***Exception: SegFault
FATAL: abort() (SIGSEGV) on thread

What was checked

Verified on unmodified origin/main that passing 0x10 crashes with SIGSEGV. With GuestCopyOut_nid_no_patch and GuestCopyIn_nid_no_patch, calls cleanly return SCE_RTC_ERROR_INVALID_POINTER (0x80B50002).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6135571607 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/13955). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-31T13:53:11Z. --- ### What happens `sceRtcGetCurrentTick`, `sceRtcGetCurrentNetworkTick`, `sceRtcGetCurrentClock`, `sceRtcGetCurrentClockLocalTime`, and `sceRtcSetCurrentTick` (`core/libs/prx/libSceRtc/Export.cpp`) crash the host process with `SIGSEGV` when passed an invalid or unwritable guest memory pointer (such as `reinterpret_cast<RtcTick*>(0x10)`). In AnyPS5, these functions check for `nullptr` and return `SCE_RTC_ERROR_INVALID_POINTER` (`0x80B50002`), but perform direct memory dereferences without verifying writability or readability via `GuestCopyOut_nid_no_patch` / `GuestCopyIn_nid_no_patch`. ### Title, test or build step `core/libs/tests/GuestRtc.cpp` ### AnyPS5 commit `origin/main` at `828ac0b2ae` ### System Windows 11 / Linux x86_64, GCC 15.2.0, Release ### Steps to reproduce Call `sceRtcGetCurrentTick(reinterpret_cast<RtcTick*>(0x10))` or `sceRtcSetCurrentTick(reinterpret_cast<const RtcTick*>(0x10))`. ### Log ``` ***Exception: SegFault FATAL: abort() (SIGSEGV) on thread ``` ### What was checked Verified on unmodified `origin/main` that passing `0x10` crashes with `SIGSEGV`. With `GuestCopyOut_nid_no_patch` and `GuestCopyIn_nid_no_patch`, calls cleanly return `SCE_RTC_ERROR_INVALID_POINTER` (`0x80B50002`).
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#13955
No description provided.