AGC: host-imported index buffers bypass the native MSAA guest-access guard #6579

Closed
opened 2026-10-15 21:13:25 +00:00 by Amoenus · 1 comment
Amoenus commented 2026-10-15 21:13:25 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T21:13:25Z.


Reproduction

Main e16b2bcce15f5cf441f8e7ad99b545e08fd24ef6 accepts a resident native MSAA color target as an index buffer, bypassing its existing guest-access refusal.

Regression-only commit changes only the existing SampleMultisampleTarget.cpp fixture; production is identical to main. The fixture draws/fills a 16x16 RGBA16F four-sample native target and verifies all 1024 samples are ones through MIMG. The ordinary resident-image guard refuses access to its guest range. Indexed draws into another target nevertheless accept that range: both 16-bit and 32-bit indices, starting at the image base or crossing its end. All four expected refusals are missing.

Valid indices starting exactly after the image render the expected triangle with per-sample coverage checks. The fixture verifies that this neighboring range and the image share the same host import. The image's 1024 samples remain unchanged after all attempts.

Validation and proposed fix

Windows 11 Enterprise 26200, WinLibs GCC 15.2r7 Release; fresh processes, Vulkan required, shader cache disabled, physical GPU identity verified in every process:

GPU Driver Main production + regression Focused fix
NVIDIA GeForce RTX 5080 (10de:2c02) 32.0.16.1062 5/5 expose all four missing refusals 5/5 pass
AMD Radeon(TM) Graphics (1002:13c0) 32.0.21036.18 5/5 expose all four missing refusals 5/5 pass

Maximum focused test process: 0.651 s. All neighbor/native-sample controls pass on both versions.

Focused fix: check the logical index range with RequireNoMultisampleTarget before input preparation. InPlaceDrawInput / HostImportFor / InPlaceIndexRange can otherwise read guest bytes directly and bind the import without going through GuestMemory::Read. The check preserves the existing current-render-target alias diagnostic and accepts the adjacent logical range.

Scope

#6480 / #6498 cover shader buffer descriptors, including runtime vertex fetches; this finding concerns the separate fixed-function index input. #6175 addresses pass hazard ordering. Complete-head source merge previews with #6498 and #5881 are clean; that is not combined runtime validation. No duplicate index guard was found in the reviewed open PRs/source and related issue searches.

Earlier validation on main 4eb91eac passed the full Windows app/libs build and 19 related groups x 5 repetitions per selector, using only #6452 as a separate Windows test-build dependency. The corresponding upstream work is now #6590; current-main validation and the fixture-oracle follow-up are below. Preserved older validation composition.

Found while extending PPSA99902 bring-up validation. No fresh title stop, startup improvement, FPS or console-equivalence claim; newer Linux component results are below. The fix restores an explicit refusal; it does not implement sample publication. AI-assisted investigation and fix: Codex.

Upstream PR and current-main validation — 2026-10-17

@MarcZX100's #6590 head 1271998d4 is validated on main 16c607a93 at composition 1ec58a5cd, including merged #5881. The source-refill and per-width destination-clear corrections are included: 12 passing fixture processes across RTX 5080, Radeon Graphics and Linux llvmpipe, plus three expected omission-control failures. Both OS relinker/libraries build; conventions, registration and diff checks pass. Exact devices, drivers, control and limits. This remains a refusal fix, not sample publication or a fresh title result.

Earlier validation and original fixture finding (historical pins)

Upstream PR and current-main validation

@MarcZX100 supplied #6590. Our new review validates its head 881facc4f on main 5d9dcc42d, with #6452 kept as a separate Windows build correction: full app/libs/checks pass, five fresh focused runs per GPU pass, and 19 related groups x 5 repetitions per GPU selector pass. Removing the guard reproduces all four missing refusals on current main production; neighboring indices and native samples stay correct. Exact pins, hardware and controls are in the review.

The review also confirms a fixture blind spot: the 32-bit neighboring draw could be omitted without failing. A focused proposed correction verifies a cleared destination before each width. The correction passes both GPUs; the omitted-draw control now fails on both. No separate competing guard PR or new title claim. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5874031295 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6579). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-15T21:13:25Z. --- ### Reproduction Main `e16b2bcce15f5cf441f8e7ad99b545e08fd24ef6` accepts a resident native MSAA color target as an index buffer, bypassing its existing guest-access refusal. [Regression-only commit](https://github.com/Amoenus/AnyPS5/commit/36b7cb5614f814359372ac664b46ea5279625ebe) changes only the existing `SampleMultisampleTarget.cpp` fixture; production is identical to main. The fixture draws/fills a 16x16 RGBA16F four-sample native target and verifies all 1024 samples are ones through MIMG. The ordinary resident-image guard refuses access to its guest range. Indexed draws into another target nevertheless accept that range: both 16-bit and 32-bit indices, starting at the image base or crossing its end. All four expected refusals are missing. Valid indices starting exactly after the image render the expected triangle with per-sample coverage checks. The fixture verifies that this neighboring range and the image share the **same host import**. The image's 1024 samples remain unchanged after all attempts. ### Validation and proposed fix Windows 11 Enterprise 26200, WinLibs GCC 15.2r7 Release; fresh processes, Vulkan required, shader cache disabled, physical GPU identity verified in every process: | GPU | Driver | Main production + regression | Focused fix | |---|---|---|---| | NVIDIA GeForce RTX 5080 (`10de:2c02`) | 32.0.16.1062 | 5/5 expose all four missing refusals | 5/5 pass | | AMD Radeon(TM) Graphics (`1002:13c0`) | 32.0.21036.18 | 5/5 expose all four missing refusals | 5/5 pass | Maximum focused test process: 0.651 s. All neighbor/native-sample controls pass on both versions. [Focused fix](https://github.com/Amoenus/AnyPS5/commit/758f4636eb143c6f4796a10594a9db3a802989b9): check the logical index range with `RequireNoMultisampleTarget` before input preparation. `InPlaceDrawInput` / `HostImportFor` / `InPlaceIndexRange` can otherwise read guest bytes directly and bind the import without going through `GuestMemory::Read`. The check preserves the existing current-render-target alias diagnostic and accepts the adjacent logical range. ### Scope #6480 / #6498 cover shader buffer descriptors, including runtime vertex fetches; this finding concerns the separate fixed-function index input. #6175 addresses pass hazard ordering. Complete-head source merge previews with #6498 and #5881 are clean; that is not combined runtime validation. No duplicate index guard was found in the reviewed open PRs/source and related issue searches. Earlier validation on main `4eb91eac` passed the full Windows app/libs build and 19 related groups x 5 repetitions per selector, using only #6452 as a separate Windows test-build dependency. The corresponding upstream work is now #6590; current-main validation and the fixture-oracle follow-up are below. Preserved [older validation composition](https://github.com/Amoenus/AnyPS5/commit/583e2cda229e5d5b2dda1c9520775066ed98ea23). Found while extending PPSA99902 bring-up validation. No fresh title stop, startup improvement, FPS or console-equivalence claim; newer Linux component results are below. The fix restores an explicit refusal; it does not implement sample publication. AI-assisted investigation and fix: Codex. <!-- codex-pr6590-validation --> ### Upstream PR and current-main validation — 2026-10-17 @MarcZX100's #6590 head `1271998d4` is validated on main `16c607a93` at [composition `1ec58a5cd`](https://github.com/Amoenus/AnyPS5/commit/1ec58a5cd4f01cec6884b5b142551441c570549d), including merged #5881. The source-refill and per-width destination-clear corrections are included: **12 passing fixture processes across RTX 5080, Radeon Graphics and Linux llvmpipe**, plus **three expected omission-control failures**. Both OS relinker/libraries build; conventions, registration and diff checks pass. [Exact devices, drivers, control and limits](https://github.com/boykopovar/AnyPS5/pull/6590#discussion_r4301434484). This remains a refusal fix, not sample publication or a fresh title result. <details> <summary>Earlier validation and original fixture finding (historical pins)</summary> ### Upstream PR and current-main validation @MarcZX100 supplied #6590. Our [new review](https://github.com/boykopovar/AnyPS5/pull/6590#pullrequestreview-5541011131) validates its head `881facc4f` on main `5d9dcc42d`, with #6452 kept as a separate Windows build correction: full app/libs/checks pass, five fresh focused runs per GPU pass, and 19 related groups x 5 repetitions per GPU selector pass. Removing the guard reproduces all four missing refusals on current main production; neighboring indices and native samples stay correct. Exact pins, hardware and controls are in the review. The review also confirms a fixture blind spot: the 32-bit neighboring draw could be omitted without failing. A [focused proposed correction](https://github.com/Amoenus/AnyPS5/commit/1bed6ac6b708ed048555c51f46f341a4a5ea931d) verifies a cleared destination before each width. The correction passes both GPUs; the omitted-draw control now fails on both. No separate competing guard PR or new title claim. AI-assisted: Codex. </details> <!-- /codex-pr6590-validation -->
MarcZX10 commented 2026-10-15 21:38:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:38:07Z.


I opened PR #6590 with the indexed-draw guard and fixture coverage for both index widths, native-target ranges, and a valid neighboring range.

The changed target compiled on Debian 12/GCC 12.2, and the conventions check passes. The local CTest binary exits before Vulkan initialization because this host lacks the AVX2/FMA required by AnyPS5. The PR's automatic eligibility, conventions, intake and report checks pass; its build jobs are skipped by the repository's PR path policy. I could not dispatch the documented full build because GitHub returned HTTP 403 requiring repository admin rights.

I also merged the current #6498 head into this PR head with git merge-tree; it is clean. #6498 checks shader buffer descriptors, while #6590 checks fixed-function index input.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202818358 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6579#issuecomment-6202818358). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:38:07Z. --- I opened [PR #6590](https://github.com/boykopovar/AnyPS5/pull/6590) with the indexed-draw guard and fixture coverage for both index widths, native-target ranges, and a valid neighboring range. The changed target compiled on Debian 12/GCC 12.2, and the conventions check passes. The local CTest binary exits before Vulkan initialization because this host lacks the AVX2/FMA required by AnyPS5. The PR's automatic eligibility, conventions, intake and report checks pass; its build jobs are skipped by the repository's PR path policy. I could not dispatch the documented full build because GitHub returned HTTP 403 requiring repository admin rights. I also merged the current #6498 head into this PR head with `git merge-tree`; it is clean. #6498 checks shader buffer descriptors, while #6590 checks fixed-function index input.
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#6579
No description provided.