fix(libkernel): gettimeofday, getitimer, setitimer and the sceKernel time getters crash on a pointer into unmapped memory instead of failing with EFAULT #10969

Closed
opened 2026-10-25 11:35:27 +00:00 by xXPBSXx · 0 comments
xXPBSXx commented 2026-10-25 11:35:27 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-25T11:35:27Z.


From a bad-pointer sweep of the libkernel exports (pointer parameter replaced by 1 and 0xfffffffffffff000): gettimeofday (both pointers), getitimer, setitimer (value and previous), sceKernelGettimeofday and sceKernelGettimezone crash the host (SIGSEGV on Linux, access violation on Windows). A null pointer is already handled. FreeBSD 11.4 fails with EFAULT: copyout in sys_gettimeofday (sys/kern/kern_time.c:646 and 651) and sys_getitimer (:745), and copyin (:803) and copyout (:808) in sys_setitimer.

Related: #8986 (getrlimit) and #8988 (getrusage) cover the same family for those two calls and are merged.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6023984078 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/10969). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-25T11:35:27Z. --- From a bad-pointer sweep of the libkernel exports (pointer parameter replaced by `1` and `0xfffffffffffff000`): `gettimeofday` (both pointers), `getitimer`, `setitimer` (value and previous), `sceKernelGettimeofday` and `sceKernelGettimezone` crash the host (SIGSEGV on Linux, access violation on Windows). A null pointer is already handled. FreeBSD 11.4 fails with EFAULT: `copyout` in `sys_gettimeofday` (sys/kern/kern_time.c:646 and 651) and `sys_getitimer` (:745), and `copyin` (:803) and `copyout` (:808) in `sys_setitimer`. Related: #8986 (getrlimit) and #8988 (getrusage) cover the same family for those two calls and are merged. AI-assisted (Claude Code).
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#10969
No description provided.