libkernel: sceKernelAvailableDirectMemorySize, sceKernelGetDirectMemoryType and sceKernelDirectMemoryQuery fault on invalid memory pointers #13566

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

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


Environment

  • AnyPS5 commit: 0a90776f7f (main)
  • Title: PS5 system software / direct memory query callers

Describe the bug

sceKernelAvailableDirectMemorySize, sceKernelGetDirectMemoryType, and sceKernelDirectMemoryQuery directly dereference guest output pointers (phys_addr_out, size_out, memory_type, start, end, and info). When a guest passes a non-null pointer into unmapped or read-only memory, the host process crashes with SIGSEGV instead of returning SCE_KERNEL_ERROR_EFAULT (0x8002000e).

Expected behavior

Invalid or unwritable guest pointers should be safely checked via GuestCopyOut_nid_no_patch and return SCE_KERNEL_ERROR_EFAULT.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6124828819 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/13566). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-30T18:30:13Z. --- ### Environment - AnyPS5 commit: 0a90776f7f (main) - Title: PS5 system software / direct memory query callers ### Describe the bug `sceKernelAvailableDirectMemorySize`, `sceKernelGetDirectMemoryType`, and `sceKernelDirectMemoryQuery` directly dereference guest output pointers (`phys_addr_out`, `size_out`, `memory_type`, `start`, `end`, and `info`). When a guest passes a non-null pointer into unmapped or read-only memory, the host process crashes with `SIGSEGV` instead of returning `SCE_KERNEL_ERROR_EFAULT` (`0x8002000e`). ### Expected behavior Invalid or unwritable guest pointers should be safely checked via `GuestCopyOut_nid_no_patch` and return `SCE_KERNEL_ERROR_EFAULT`.
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#13566
No description provided.