fix(libSceCdlgPlayerReview): return INVALID_ARGUMENT from scePlayerReviewDialogGetResult for an unwritable result #14959

Merged
fogydes merged 1 commit from upstream-pr/14959 into main 2026-11-03 05:12:30 +00:00
fogydes commented 2026-11-02 05:06:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-11-02T05:06:11Z.


What

Validate the destination pointer in scePlayerReviewDialogGetResult via GuestCopyOut_nid_no_patch preserving errno, returning COMMON_DIALOG_ERROR_INVALID_ARGUMENT (0x80B8000Au) when the output buffer is unwritable rather than causing an unhandled host access violation.

Tested

Windows 11 x86_64, ctest --test-dir build -R guest_player_review_dialog -V (100% pass). Verified unwritable pointer reinterpret_cast<CommonDialogResultPrefix*>(0x10) returns COMMON_DIALOG_ERROR_INVALID_ARGUMENT.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5115264362 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14959). Originally posted by [fogydes](https://github.com/fogydes) on 2026-11-02T05:06:11Z. --- ### What Validate the destination pointer in `scePlayerReviewDialogGetResult` via `GuestCopyOut_nid_no_patch` preserving `errno`, returning `COMMON_DIALOG_ERROR_INVALID_ARGUMENT` (`0x80B8000Au`) when the output buffer is unwritable rather than causing an unhandled host access violation. ### Tested Windows 11 x86_64, `ctest --test-dir build -R guest_player_review_dialog -V` (100% pass). Verified unwritable pointer `reinterpret_cast<CommonDialogResultPrefix*>(0x10)` returns `COMMON_DIALOG_ERROR_INVALID_ARGUMENT`. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
BunnyFl commented 2026-11-02 16:06:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T16:06:50Z.

Review: COMMENTED


A firmware note for the debt entry, not a blocker. The checked copy keeps the host from faulting.

Firmware 13.42's libSceCdlgPlayerReview.sprx (sha256 09339a41ceea4297c6ad8b7e5761aa6eb3a60e0139f05805f2542f52f18c1737) at 0x500 (VuKbx6zlEG4), read from disassembly only, not measured on a console:

50a: test rdi, rdi ; je 565          ; 565: 0x80b8000d (null)
519: lock ; 51e: dialog = [0xc020] ; null -> 0x80b80003
52d: call 0x870 ; false -> 0x80b80005
...  status checks: 0x80b8000a, 0x80b8000e
57b: mov [rbx+8], r14d               ; direct store into result->result

The module tests only for null, then stores straight through the pointer, so the console faults on an unwritable non-null pointer. The new debt sentence says console behaviour "has not" been established, but the module settles it. Could it say instead: "Firmware 13.42 checks only for null and stores directly, so the console faults on an unwritable non-null pointer; AnyPS5 returns COMMON_DIALOG_ERROR_INVALID_ARGUMENT instead."?

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5739500430 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14959#pullrequestreview-5739500430). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T16:06:50Z. **Review:** COMMENTED --- A firmware note for the debt entry, not a blocker. The checked copy keeps the host from faulting. Firmware 13.42's `libSceCdlgPlayerReview.sprx` (sha256 `09339a41ceea4297c6ad8b7e5761aa6eb3a60e0139f05805f2542f52f18c1737`) at `0x500` (`VuKbx6zlEG4`), read from disassembly only, not measured on a console: ``` 50a: test rdi, rdi ; je 565 ; 565: 0x80b8000d (null) 519: lock ; 51e: dialog = [0xc020] ; null -> 0x80b80003 52d: call 0x870 ; false -> 0x80b80005 ... status checks: 0x80b8000a, 0x80b8000e 57b: mov [rbx+8], r14d ; direct store into result->result ``` The module tests only for null, then stores straight through the pointer, so the console faults on an unwritable non-null pointer. The new debt sentence says console behaviour "has not" been established, but the module settles it. Could it say instead: "Firmware 13.42 checks only for null and stores directly, so the console faults on an unwritable non-null pointer; AnyPS5 returns COMMON_DIALOG_ERROR_INVALID_ARGUMENT instead."?
Sign in to join this conversation.
No reviewers
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!14959
No description provided.