Repository navigation
fix(libSceAgcDriver): safely probe output memory size in sceAgcDriverQueryResourceRegistrationUserMemoryRequirements - #19999
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the inspected implementation safely probes the output pointer and preserves errno on the expected failure path.
What I ran
Reviewed head 8c51402b6d306bc0bf48b35ac389aa40868bba5f. No commands or tests were run; repository files were read through repo_read.py.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Implementation and regression case inspected |
| Automated checks | not run | Description reports checks; not independently run |
| Console behavior | not run | Host-safety fallback is documented as unmeasured on console |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported convention check and unit test were not run during this review. No console or cross-host behavior was tested. The changed files listed in the manifest were all read; files.json was not available through the reader.
To get this to a good state
Nothing is required.
|
Linux test report for 8c51402, merged onto
|
|
@oneandonlydean All CI checks have passed cleanly, @MarcZX10 approved the head, and @c1b3r-p3d1a verified Linux test execution with negative controls passing. Ready for merge whenever you have a moment! |
|
Windows check of head
AI-assisted: yes. |
Linux check of head
|
| Linux | |
|---|---|
| Setup | Ubuntu 24.04.4 LTS (WSL2), GCC 13 |
| Build | clean |
| Passed | 1609 of 1886 |
| Failed | 99 |
| Not run (executable missing or test disabled) | 178 |
| Failures caused by this PR | 0 |
| Counter-check | 0 of 1 tests fail without the change |
| Conventions | pass |
| Time | 20 min |
| Tests that ran | Linux |
|---|---|
agc_driver_* |
1037 of 1270 |
guest_system_* |
63 of 63 |
agc_shader_* |
53 of 53 |
guest_job_* |
29 of 29 |
agc_pipeline_* |
23 of 24 |
agc_storage_* |
12 of 20 |
guest_freetype_* |
15 of 15 |
guest_np_* |
14 of 14 |
| 199 other group(s) | 363 of 398 |
99 failed test(s) that also fail on main (not caused by this PR)
agc_carried_shadow, agc_collect_coverage_invalidation, agc_driver_bc_block_copy, agc_driver_depth_compare_copy, agc_driver_depth_plane_partial_store_upload_image, agc_driver_frame_replay, agc_driver_frame_replay_allocation_ranges, agc_driver_frame_replay_busy_queue, agc_driver_frame_replay_cold_pipelines, agc_driver_frame_replay_concurrent, agc_driver_frame_replay_fence_reuse, agc_driver_frame_replay_late_clear, agc_driver_frame_replay_once, agc_driver_frame_replay_partly_covered, agc_driver_frame_replay_pending_result, agc_driver_frame_replay_rewind, agc_driver_frame_replay_rewind_compute, agc_driver_frame_replay_rewind_copy, agc_driver_frame_replay_rewind_fill, agc_driver_frame_replay_rewind_page, agc_driver_frame_replay_rewind_release, agc_driver_frame_replay_rewind_reuse, agc_driver_frame_replay_rewind_split, agc_driver_frame_replay_rewind_store, agc_driver_frame_replay_shader, agc_driver_frame_replay_shader_host, agc_driver_frame_replay_shader_prologue_code, agc_driver_frame_replay_shader_prologue_header, agc_driver_frame_replay_shader_prologue_readonly, agc_driver_frame_replay_store_between_walks, agc_driver_frame_replay_wait_label, agc_driver_host_import_dma_buf_watch, agc_driver_image_srgb_sample_copy, agc_driver_image_srgb_sample_copy_forced, agc_driver_image_table_packed_guards, agc_driver_image_table_reuse_records, agc_driver_image_table_reuse_records_narrow, agc_driver_image_table_variants, agc_driver_image_table_vouch_queued_draws, agc_driver_lookup_log_fits_build, agc_driver_msaa_dcc_clear_2, agc_driver_msaa_dcc_clear_4, agc_driver_msaa_dcc_clear_8, agc_driver_msaa_dcc_compared_import_2, agc_driver_msaa_dcc_compared_import_4, agc_driver_msaa_dcc_compared_import_8, agc_driver_msaa_dcc_srgb_clear_2, agc_driver_msaa_dcc_srgb_clear_4, agc_driver_msaa_dcc_srgb_clear_8, agc_driver_native_color_initial_uniform_refusals, agc_driver_native_depth_aliased_depth_depth_only, agc_driver_native_depth_aliased_depth_no_stencil, agc_driver_native_depth_aliased_depth_stencil, agc_driver_native_depth_aliased_stencil, agc_driver_native_depth_bare_publication, agc_driver_native_depth_bda_clear, agc_driver_native_depth_buffer_clear, agc_driver_native_depth_clear_refusals, agc_driver_native_depth_clears, agc_driver_native_depth_covered_owner, agc_driver_native_depth_driver_path, agc_driver_native_depth_driver_queued_fill, agc_driver_native_depth_expand_gate, agc_driver_native_depth_htile_plane_alias, agc_driver_native_depth_initial_owner, agc_driver_native_depth_overwritten_planes, agc_driver_native_depth_overwritten_published, agc_driver_native_depth_pending_units, agc_driver_native_depth_publication, agc_driver_native_depth_publication_without_htile, agc_driver_native_depth_retirement, agc_driver_native_depth_separate_stencil, agc_driver_native_depth_single_sample_view, agc_driver_native_depth_smaller_extent, agc_driver_native_depth_stencil, agc_driver_native_depth_stencil_view, agc_driver_native_depth_stored_repeat_fill, agc_driver_native_depth_uneven_plane, agc_driver_native_depth_uniform_plane_alias, agc_driver_native_depth_uniform_planes, agc_driver_native_multisample_depth, agc_driver_recorder, agc_driver_resource_cache_collect_refusals, agc_driver_resource_cache_collect_refusals_index, agc_driver_resource_cache_collect_refusals_narrow, agc_driver_resource_cache_lookup_changed, agc_driver_resource_cache_pending_fail_count, agc_driver_resource_cache_pending_fail_count_index, agc_driver_resource_cache_replaced_texture, agc_driver_sample_multisample_target, agc_driver_sampled_cache_budget, agc_driver_sampled_cache_budget_without_storage_image_multisample, agc_driver_sampled_clear_keys, agc_driver_staged_clear_sampled_read, agc_driver_staged_clear_sampled_read_draw_pipeline, agc_driver_staged_clear_sampled_read_plan_verify, agc_driver_storage_flush_ordering, agc_storage_idle_writeback_race, agc_storage_kept_unit_settle
178 test(s) not run
agc_collect_mapping_history_map, agc_collect_mapping_history_uncached, agc_draw_input_mirrors, agc_draw_input_mirrors_off, agc_draw_input_reuse, agc_driver_alpha_to_coverage_sample_mask_export, agc_driver_bda_reads_shadowed_results, agc_driver_bda_reads_shadowed_results_per_build, agc_driver_bitfield_mask, agc_driver_cached_image_multisample_guard, agc_driver_coherent_atomic_loads, agc_driver_coherent_atomic_loads_enabled, agc_driver_conservative_rasterization, agc_driver_dcc_keys_partial_rewrite_keeps_store, agc_driver_dcc_keys_rewrite_after_epoch_proof, agc_driver_dcc_keys_rewrite_after_memo, agc_driver_dcc_keys_rewrite_after_refresh_proof, agc_driver_dcc_keys_rewrite_to_register_clear, agc_driver_dcc_keys_write_beside_keys_keeps_store, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_guest_layers, agc_driver_dithered_alpha_to_coverage, agc_driver_dpp16_inactive_source, agc_driver_dpp16_operands, agc_driver_dpp16_row_share_xmask, agc_driver_dpp8, agc_driver_ds_append_consume, agc_driver_ds_permute, agc_driver_ds_swizzle, agc_driver_float16_nan_probe, agc_driver_float16_native, agc_driver_float16_unused_nan_payloads, agc_driver_gcn_compare_exec_writes, agc_driver_gds_append_consume, agc_driver_global_atomic_csub, agc_driver_global_store_addtid, agc_driver_host_write_shadowed_unit, agc_driver_idle_store_over_unmap, agc_driver_image_sample_lod_clamp, agc_driver_image_table_reuse_retaken_cleared_depth_surface, agc_driver_image_table_reuse_retaken_depth_surface, agc_driver_image_table_reuse_retaken_mirrored_depth_surface, agc_driver_image_table_reuse_retired_depth_surface, agc_driver_image_table_vouched_lookups, agc_driver_large_tracked_snapshot, agc_driver_layered_volume_mesh, agc_driver_lds_addtid, agc_driver_lds_mask_waterfall, agc_driver_lds_subword_store_branch, agc_driver_lds_tree_reduction, agc_driver_linear_target_direct_write_completion, agc_driver_linear_target_dma_buf_creation, agc_driver_linear_target_dma_buf_refusal, agc_driver_linear_target_dma_buf_watch_loss_after, agc_driver_linear_target_dma_buf_watch_loss_before, agc_driver_linear_target_import_creation, agc_driver_look_back_scan, agc_driver_memo_pending_collect, agc_driver_memo_pending_collect_compared, agc_driver_mesh, agc_driver_mesh_barycentric_emulation, agc_driver_mesh_draw_relocation, agc_driver_mesh_index_cache, agc_driver_mesh_provoking_layer, agc_driver_mesh_provoking_vertex, agc_driver_mesh_waves, agc_driver_multisample_centered_lines, agc_driver_native_fmask_2, agc_driver_native_fmask_8, agc_driver_ngg_vertex_wave_info, agc_driver_ngg_vertex_wave_reduction, agc_driver_optimize_on_fiber, agc_driver_packed_float16_native, agc_driver_partially_committed_array, agc_driver_partially_committed_array_samples, agc_driver_partially_committed_volume, agc_driver_partially_committed_volume_bc, agc_driver_partially_committed_volume_bc_samples, agc_driver_partially_committed_volume_compare, agc_driver_partially_committed_volume_empty, agc_driver_partially_committed_volume_empty_samples, agc_driver_partially_committed_volume_linear, agc_driver_partially_committed_volume_linear_samples, agc_driver_partially_committed_volume_mips, agc_driver_partially_committed_volume_mips_samples, agc_driver_partially_committed_volume_page_samples, agc_driver_partially_committed_volume_samples, agc_driver_partially_committed_volume_thick, agc_driver_partially_committed_volume_thick_samples, agc_driver_partially_committed_volume_whole, agc_driver_partially_committed_volume_whole_samples, agc_driver_partially_resident_pending_stores, agc_driver_partially_resident_snapshot, agc_driver_permlane16, agc_driver_pipeline_optimized_readback_color32, agc_driver_pipeline_optimized_readback_color32_fast, agc_driver_pipeline_optimized_readback_color32_unsuppressed, agc_driver_pipeline_optimized_readback_color64, agc_driver_pipeline_optimized_readback_color64_fast, agc_driver_pipeline_optimized_readback_color64_unsuppressed, agc_driver_pipeline_statistics_report, agc_driver_pixel_helper_lanes, agc_driver_pixel_helper_waterfall, agc_driver_pixel_lds, agc_driver_pixel_lds_lane_slots, agc_driver_pixel_lds_limit, agc_driver_pixel_quad_perm_helpers, agc_driver_pixel_valid_mask, agc_driver_read_first_lane, agc_driver_read_lane, agc_driver_recorded_draw_staging, agc_driver_relative_dpp, agc_driver_relative_indexing_known_bits, agc_driver_repeated_fill_elision, agc_driver_resident_heap_mirror, agc_driver_sample_order_grid_reference, agc_driver_sample_order_recipe_depth_locations, agc_driver_scalar_bit_count, agc_driver_scattered_runs, agc_driver_selected_dma_buf_list_refusal, agc_driver_selected_dma_buf_list_refusal_access, agc_driver_selected_sparse_dma_buf_failure, agc_driver_spanned_ballot_sequence, agc_driver_sparse_dma_buf_import, agc_driver_stencil_copy_draw, agc_driver_storage_guest_copy_release, agc_driver_subvector_loop, agc_driver_table_index_validation, agc_driver_tessellation_geometry, agc_driver_texture_sparse_levels, agc_driver_two_sample_alpha_to_coverage_sample_mask_export, agc_driver_two_sample_dithered_alpha_to_coverage, agc_driver_unit_shadow, agc_driver_unit_shadow_budget, agc_driver_upload_cache_read_only_flush, agc_driver_vertex_clip_cull_distances, agc_driver_wait_idle_queue_locks, agc_driver_wave32_subgroup, agc_driver_wave_shared_vgprs, agc_driver_wave_uniform, agc_driver_write_lane, agc_hook_clear_access, agc_hook_clear_access_off, agc_host_import_sparse, agc_idle_publish_dmabuf_wait, agc_idle_publish_wait, agc_import_settle_initial_dcc, agc_map_gate_disjoint, agc_map_gate_fast_path, agc_map_gate_pending, agc_map_gate_publication, agc_map_gate_retry, agc_map_gate_stress, agc_pipeline_cache_file, agc_repeated_neighbour_stores, agc_shadowed_key_stores, agc_shared_write_partial_collect, agc_small_tiled_shadow_label, agc_snapshot_read_into_staging, agc_storage_clear_hand_over, agc_storage_pending_after_unwatch, agc_storage_pending_key_refresh, agc_storage_rewritten_blocks, agc_storage_rewritten_stale_units, agc_storage_written_buffer_order, agc_unit_shadow, agc_unit_shadow_completion_store, agc_unwatch_hook_lock_order, agc_unwatch_snapshot_scope, agc_unwatch_snapshot_scope_edge, agc_unwatch_snapshot_scope_linear, agc_unwatch_snapshot_scope_linear_refresh, agc_unwatch_snapshot_scope_refresh, agc_write_tracking, agc_write_tracking_generation_wrap, agc_write_tracking_mark_order
Only tests that depend on the files this PR changes were run. A test counts against the PR only if it passes on main. Numbers come from ctest; the text is generated by a script.
8c51402 to
f40030d
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The changed implementation safely copies the required size to guest memory, preserves errno, and handles copy-out failure; I found no verified blocking defect.
What I ran
Reviewed head f40030d7571631cd2d98b579dfe9eb36bef6b139 using repo_read.py for the prepared diff and targeted source context. No tests or other commands were run.
Results
| Check | Result | Note |
|---|---|---|
| Code review | passed | Changed behavior and regression test reviewed |
| Automated checks | not run | No commands executed |
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests or convention/audit checks were run. Physical console behavior remains unmeasured, as the updated documentation states. Read all changed files: core/libs/prx/libSceAgcDriver/Resource/src/Lifecycle.cpp, core/libs/tests/GuestAgcDriverResources.cpp, and docs/dev/debt/libSceAgcDriver.md; no changed files were excluded.
To get this to a good state
Nothing is required.
f40030d to
eece2e9
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the review evidence supports merging.
What I ran
Reviewed head eece2e95f2aecb9d79c16cea5b740dd81dd5e44e using the prepared diff and pinned repository reader. No tests or prechecks were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | Three changed files read |
| Tests and prechecks | not run | Author reports checks; not independently verified |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests, convention checks, the guest pointer audit, and console behavior were not run or confirmed. The review artifacts description.md, commits.md, manifest.json, and diff.patch were read. All three files listed in the manifest as reviewed were read: core/libs/prx/libSceAgcDriver/Resource/src/Lifecycle.cpp, core/libs/tests/GuestAgcDriverResources.cpp, and docs/dev/debt/libSceAgcDriver.md. files.json was not available through the reader.
To get this to a good state
Nothing is required.
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
|
Thank you @kiwe147 for verifying that |
|
My draft #21520 overlaps this PR's safe copy-out change, and also changes the query result/output and initializer result. I propose merging #19999 first, then rebasing #21520 onto it so pointer safety remains attributed here and my PR contains only the additional semantic change and regression coverage. The public obSCEne probe initializes a uint64_t output to 0xbeefcafebeefcafe, and its PS5 12.40 log records output zero and return 0x8A6C9018. OpenAGC supplies reference-implementation support for the initializer and null-query result; those remain unmeasured on console. I will keep those evidence limits explicit. Would that merge order work for you? #21520 will stay draft until the overlap is agreed and its rebased head is validated. |
…QueryResourceRegistrationUserMemoryRequirements
…rQueryResourceRegistrationUserMemoryRequirements
eece2e9 to
6dd0603
Compare
|
@oneandonlydean Rebased onto latest
|
What
This pull request ensures that output pointer
size_in_bytespassed tosceAgcDriverQueryResourceRegistrationUserMemoryRequirementsinlibSceAgcDriveris safely probed viaGuestCopyOut_nid_no_patchbefore dereferencing, avoiding host segmentation faults on unwritable or unmapped guest memory.Specifically:
0x4000) required registration user memory size viaGuestCopyOut_nid_no_patch. If copy-out fails, restores guesterrnoand returnsAGC_EINVAL(0x80020065u) instead of causing a host hardware segmentation fault.core/libs/tests/GuestAgcDriverResources.cppverifying rejection of unwritable output pointers (reinterpret_cast<uint64_t*>(0x10)) withAGC_EINVALand errno preservation.docs/dev/debt/libSceAgcDriver.md.Tested
python tools/check_conventions.py --base origin/main(0 findings, 0 errors).python tools/guest_pointer_audit.py libSceAgcDriver(0 remaining findings insceAgcDriverQueryResourceRegistrationUserMemoryRequirements).GuestAgcDriverResources.cpp.Checklist