[removed by author] #280

Merged
thegl0w merged 8 commits from upstream-pr/284 into main 2026-11-21 21:26:31 +00:00
thegl0w commented 2026-11-21 20:34:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by thegl0w on 2026-11-21T20:34:44Z.


[removed by author]

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5432142309 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/284). Originally posted by [thegl0w](https://github.com/thegl0w) on 2026-11-21T20:34:44Z. --- [removed by author]
upstream-sync closed this pull request 2026-11-24 06:42:13 +00:00
R0Y00 commented 2026-11-24 06:48:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T20:55:54Z.


TitleLookup checks only the first byte, but both shaders use the result for a four-byte raw UAV operation. A start inside the last three bytes currently reports success, and an unaligned offset can reach a raw load/store or atomic. Please validate the entire aligned DWORD access before issuing it (or keep the helper byte-oriented and check at its callers). Add last-valid-word, tail-crossing and misaligned controls, with unchanged backing words for rejected writes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7069110736 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/284#issuecomment-7069110736). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T20:55:54Z. --- `TitleLookup` checks only the first byte, but both shaders use the result for a four-byte raw UAV operation. A start inside the last three bytes currently reports success, and an unaligned offset can reach a raw load/store or atomic. Please validate the entire aligned DWORD access before issuing it (or keep the helper byte-oriented and check at its callers). Add last-valid-word, tail-crossing and misaligned controls, with unchanged backing words for rejected writes.
thegl0w commented 2026-11-24 06:48:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by thegl0w on 2026-11-21T21:23:32Z.


AI-generated: this reply was written by Claude (Claude Code), an AI assistant, and posted with the account owner's approval.

Thanks, agreed. 1c19cb6 validates the entire aligned DWORD before any access is issued.

TitleLookup now takes the access size (bytes, a multiple of 4). It succeeds only when:

  • the address is 4-byte aligned;
  • the whole [address, address + bytes) lies inside one range, checked as bytes <= size && start <= size - bytes on the in-range offset.

Both shaders call it with 4. shader_ranges also rejects a range that does not start on a 4-byte boundary, since that would misalign the raw offsets even for an aligned address.

Controls added:

  • Tail-crossing: the placed allocation's range now ends two bytes short of its allocation, so its last aligned word crosses the range end with two bytes inside.
  • gpu_alias_lookup: reads each range's last valid word (a hit), the aligned word after it (a miss; tail-crossing for the placed range), and misaligned starts at +1/+2/+3 and end-1/-2/-3. That makes 150 records with 48 misses.
  • gpu_alias_lookup_writes: adds a rejected store and a float min on the tail-crossing word, and misaligned store, add and sub inside ranges. All of them must report 0. Every word of all four allocations is then compared through the title pointers, which checks that rejected writes leave the backing words unchanged, including the two in-range bytes of the tail-crossing word. The last valid word of each range is also a successful store.
  • era_title_va_shader: covers the unaligned-start rejection.

Negative controls: each of these fails both GPU tests on WARP.

  • Removing the span check: tail-crossing hit at lookup record 107, and the write reported success.
  • Removing the alignment check: misaligned hit at lookup record 6.
  • Restoring the earlier first-byte-only check.

Results at 1c19cb6, Windows 11 build 26300, debug layer unavailable locally:

  • gpu_alias_lookup_warp and gpu_alias_lookup_writes_warp passed on WARP 10.0.26100.9818 with mismatches 0.
  • The hardware variants were not re-run for this commit.
  • Full CI-equivalent run: configure and build succeeded; 110/110 tests passed (bvh_wave64_warp and wave_shuffle_warp skipped, as on main on this PC). A strict /W4 /WX /permissive- compile of the host sources is clean, and the earlier table mutants are still caught.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7069440529 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/284#issuecomment-7069440529). Originally posted by [thegl0w](https://github.com/thegl0w) on 2026-11-21T21:23:32Z. --- > **AI-generated:** this reply was written by Claude (Claude Code), an AI assistant, and posted with the account owner's approval. Thanks, agreed. `1c19cb6` validates the entire aligned DWORD before any access is issued. **`TitleLookup` now takes the access size** (`bytes`, a multiple of 4). It succeeds only when: - the address is 4-byte aligned; - the whole `[address, address + bytes)` lies inside one range, checked as `bytes <= size && start <= size - bytes` on the in-range offset. Both shaders call it with 4. **`shader_ranges` also rejects a range that does not start on a 4-byte boundary**, since that would misalign the raw offsets even for an aligned address. **Controls added:** - **Tail-crossing:** the placed allocation's range now ends two bytes short of its allocation, so its last aligned word crosses the range end with two bytes inside. - **`gpu_alias_lookup`:** reads each range's last valid word (a hit), the aligned word after it (a miss; tail-crossing for the placed range), and misaligned starts at `+1/+2/+3` and `end-1/-2/-3`. That makes 150 records with 48 misses. - **`gpu_alias_lookup_writes`:** adds a rejected store and a float min on the tail-crossing word, and misaligned store, add and sub inside ranges. All of them must report 0. Every word of all four allocations is then compared through the title pointers, which checks that rejected writes leave the backing words unchanged, including the two in-range bytes of the tail-crossing word. The last valid word of each range is also a successful store. - **`era_title_va_shader`:** covers the unaligned-start rejection. **Negative controls:** each of these fails both GPU tests on WARP. - Removing the span check: tail-crossing hit at lookup record 107, and the write reported success. - Removing the alignment check: misaligned hit at lookup record 6. - Restoring the earlier first-byte-only check. **Results at `1c19cb6`, Windows 11 build 26300, debug layer unavailable locally:** - `gpu_alias_lookup_warp` and `gpu_alias_lookup_writes_warp` passed on WARP 10.0.26100.9818 with mismatches 0. - The hardware variants were not re-run for this commit. - Full CI-equivalent run: configure and build succeeded; 110/110 tests passed (`bvh_wave64_warp` and `wave_shuffle_warp` skipped, as on `main` on this PC). A strict `/W4 /WX /permissive-` compile of the host sources is clean, and the earlier table mutants are still caught.
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
R0Y00/Xbox2Windows!280
No description provided.