libSceMsgDialog: sceMsgDialogGetResult faults on unwritable result pointers instead of returning ARG_NULL #13959

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

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


What happens

sceMsgDialogGetResult (core/libs/prx/libSceMsgDialog.native/Export.cpp:53) crashes the host process with SIGSEGV when passed an invalid or unwritable guest memory pointer (such as reinterpret_cast<MsgDialogResult*>(0x10)).

In AnyPS5, sceMsgDialogGetResult checks for nullptr and returns COMMON_DIALOG_ERROR_ARG_NULL (0x80B8000D), but directly writes to *result without checking memory writability via GuestCopyOut_nid_no_patch.

Title, test or build step

core/libs/tests/GuestMsgDialogNative.cpp

AnyPS5 commit

origin/main at 828ac0b2ae

System

Windows 11 / Linux x86_64, GCC 15.2.0, Release

Steps to reproduce

Call sceMsgDialogGetResult(reinterpret_cast<MsgDialogResult*>(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, the call safely returns COMMON_DIALOG_ERROR_ARG_NULL (0x80B8000D).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6135640047 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/13959). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-31T13:59:52Z. --- ### What happens `sceMsgDialogGetResult` (`core/libs/prx/libSceMsgDialog.native/Export.cpp:53`) crashes the host process with `SIGSEGV` when passed an invalid or unwritable guest memory pointer (such as `reinterpret_cast<MsgDialogResult*>(0x10)`). In AnyPS5, `sceMsgDialogGetResult` checks for `nullptr` and returns `COMMON_DIALOG_ERROR_ARG_NULL` (`0x80B8000D`), but directly writes to `*result` without checking memory writability via `GuestCopyOut_nid_no_patch`. ### Title, test or build step `core/libs/tests/GuestMsgDialogNative.cpp` ### AnyPS5 commit `origin/main` at `828ac0b2ae` ### System Windows 11 / Linux x86_64, GCC 15.2.0, Release ### Steps to reproduce Call `sceMsgDialogGetResult(reinterpret_cast<MsgDialogResult*>(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`, the call safely returns `COMMON_DIALOG_ERROR_ARG_NULL` (`0x80B8000D`).
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#13959
No description provided.