fix(libSceWebBrowserDialog): return ARG_NULL from result for unwritable pointers #16746

Closed
Kikoarl wants to merge 1 commit from upstream-pr/16746 into main
Kikoarl commented 2026-11-07 15:07:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-11-07T15:07:17Z.


What

Validate guest result and extended pointers in sceWebBrowserDialogGetResult using GuestCopyIn_nid_no_patch and GuestCopyOut_nid_no_patch with caller errno preservation. When unmapped memory (0x10) or read-only memory (.rodata) is provided for result or extended structures, return 0x80B8000D (COMMON_DIALOG_ERROR_ARG_NULL) instead of crashing the host process. Document the host-safety fallback under ### Functional in docs/dev/debt/libSceWebBrowserDialog.md.

Tested

  • Linux (x86_64), ctest --test-dir /tmp/anyps5_build -R "^guest_web_browser_dialog" --output-on-failure (100% pass, 2/2 tests passed, 0.07s).
  • Differential regression test in core/libs/tests/GuestWebBrowserDialog.cpp: verified that sceWebBrowserDialogGetResult safely returns COMMON_DIALOG_ERROR_ARG_NULL (0x80B8000D) and preserves errno when passed unmapped (0x10) or read-only (.rodata) memory for result and extended (fails on origin/main with SIGSEGV).
  • Verified python3 tools/check_conventions.py --base origin/main with 0 errors and 0 warnings.

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:5202907595 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16746). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-11-07T15:07:17Z. --- ### What Validate guest result and extended pointers in `sceWebBrowserDialogGetResult` using `GuestCopyIn_nid_no_patch` and `GuestCopyOut_nid_no_patch` with caller `errno` preservation. When unmapped memory (`0x10`) or read-only memory (`.rodata`) is provided for result or extended structures, return `0x80B8000D` (`COMMON_DIALOG_ERROR_ARG_NULL`) instead of crashing the host process. Document the host-safety fallback under `### Functional` in `docs/dev/debt/libSceWebBrowserDialog.md`. ### Tested - Linux (x86_64), `ctest --test-dir /tmp/anyps5_build -R "^guest_web_browser_dialog" --output-on-failure` (100% pass, 2/2 tests passed, 0.07s). - Differential regression test in `core/libs/tests/GuestWebBrowserDialog.cpp`: verified that `sceWebBrowserDialogGetResult` safely returns `COMMON_DIALOG_ERROR_ARG_NULL` (`0x80B8000D`) and preserves `errno` when passed unmapped (`0x10`) or read-only (`.rodata`) memory for `result` and `extended` (fails on `origin/main` with SIGSEGV). - Verified `python3 tools/check_conventions.py --base origin/main` with 0 errors and 0 warnings. ### Checklist - [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

Pull request closed

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!16746
No description provided.