Skip to content

fix(libSceVrServiceDialog): return ARG_NULL when open param is unreadable - #22003

Closed
Kikoarl wants to merge 1 commit into
boykopovar:mainfrom
Kikoarl:fix/libSceVrServiceDialog-open-param-unreadable
Closed

Kikoarl wants to merge 1 commit into
boykopovar:mainfrom
Kikoarl:fix/libSceVrServiceDialog-open-param-unreadable

Conversation

@Kikoarl

@Kikoarl Kikoarl commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

What

Safely probe the guest parameter pointer with GuestCopyIn_nid_no_patch in sceVrServiceDialogOpen before transition, preserving caller errno and returning COMMON_DIALOG_ERROR_ARG_NULL (0x80B8000D) if unreadable.

Tested

  • Unit tests in tests/guest_vr_service_dialog_tests verifying unreadable parameter refusal and errno preservation.
  • Passes python3 tools/check_conventions.py --base origin/main.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: none
  • AI-assisted: yes

@PrivacyOnion PrivacyOnion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 79dc3ce267:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_vr_service_dialog_tests built cleanly.
  • CTest (guest_vr_service_dialog):
    1/1 Test #5044: guest_vr_service_dialog ..........   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceVrServiceDialog/Export.cpp reverted to main and the new tests kept, the suite fails:
    1/1 Test #5044: guest_vr_service_dialog ..........Subprocess aborted***Exception:   0.28 sec
    0% tests passed, 1 tests failed out of 1
    
    Restoring the change makes it pass again.
  • Code reading:
    • Verified sceVrServiceDialogOpen in core/libs/prx/libSceVrServiceDialog/Export.cpp checks param == nullptr before GuestCopyIn_nid_no_patch probe and returns COMMON_DIALOG_ERROR_ARG_NULL (0x80B8000D).
    • Verified caller errno preservation around GuestCopyIn_nid_no_patch both on the failure return path and success path in sceVrServiceDialogOpen.
    • Verified guest pointer probe correctly uses GuestCopyIn_nid_no_patch with std::uint8_t probe byte without out-of-bounds access or unhandled memory fault.
    • Verified state check order in sceVrServiceDialogOpen: COMMON_DIALOG_STATUS_NONE (COMMON_DIALOG_ERROR_NOT_INITIALIZED), then COMMON_DIALOG_STATUS_RUNNING (COMMON_DIALOG_ERROR_BUSY), then param null/unreadable checks.
    • Verified unit tests in core/libs/tests/GuestVrServiceDialog.cpp test invalid pointer 0x10 returns kErrArgNull and preserves errno 71 without corrupting global dialog state.

Looks Good To Me

@ycbuzi

ycbuzi commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Tested 79dc3ce267 merged into main, with the whole ctest suite on each machine below. Nothing fails that does not also fail on main on the same machine.

  • Windows Server 2022 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 99% tests passed, 4 tests failed out of 6013; 99% tests passed, 5 tests failed out of 6013. 5 of the failing tests fail on main too. run
  • Windows Server 2025 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 99% tests passed, 1 tests failed out of 6013; 99% tests passed, 1 tests failed out of 6013. 1 of the failing tests fail on main too. run

AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports.

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head 79dc3ce267, applied with git apply (with -C1, context shifted) on main fd4aeed483 together with the other 29 PRs of one batch (#16191, #16207, #17573, #18945, #20978, #21054, #22002, #22042, #22078, #22822, #24354, #24484, #12860, #18915, #19999, #22160, #22890, #22891, #23488, #23751, #24051, #24578, #14506, #19462, #22206, #22291, #22627, #24048, #24424). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
guest_vr_service_dialog (1 test, matched by name to the test file this PR changes) all pass outside the iGPU subset

Whole batch: the full ctest -j 12 (6526 tests) on the RTX 3080 has 15 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. Traced to other PRs of the batch, each by reverting it and testing again: #12860 (guest_user_service_account_name_limits, guest_user_service_age_level_guest_bounds, guest_user_service_initial_user_bounds, guest_user_service_kratos), #22891 (nkwebkit_securityorigin), #18915 (public_headers); none is in this PR's area. Failing tests I could not trace to a single PR (reverting the likely candidates did not clear them): guest_apr_read_longeof, guest_filesystem, guest_kernel_rename, guest_windows_directory_link_types, tools_patch_advisor_json, tools_suggest_patches. The 2125 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

Nothing blocks this change; the behavior is consistent with the stated goal, and no verified blocking defect was found.

What I ran

Read the prepared diff and both changed files at head 79dc3ce26726ee0c668e3ecf9c85dce951064132, plus the existing GuestCopyIn_nid_no_patch probe pattern. No commands or tests were run.

Results

Check Result Note
Diff and changed files passed Both changed files were read
Unit tests and conventions check not run Reported by the author only

Findings

Blocking

None.

Non-blocking

None.

Not verified

Tests and the conventions check were not run. The prepared files.json and bundle copies of the changed files could not be accessed through the available reader; the changed files were read from the pinned repository head. No changed files were excluded according to manifest.json.

To get this to a good state

Nothing is required.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Kikoarl, I am closing this one. On main this Open function never reads param, it only checks it for null, so an unreadable pointer cannot crash the host here, and the ARG_NULL answer for it is not measured on a console. That leaves a guessed error code for a case no title is known to hit. If you have a title that passes such a pointer, together with what a retail PS5 returns, please reopen with that and it goes to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants