DirectStorage: reject file ranges past end before allocation #1427

Closed
github-bot wants to merge 1 commit from gh-pr/1427/head into gh-pr/1427/base
Owner

@⁠hajduzsolt on GitHub · 2026-11-24 15:51 UTC · original
hajduzsolt:fix/dstorage-file-range-check → main · +21 −0 · 1 files · 1 commits · closed without merging

A file-source request allocates its staging buffer before discovering that the requested range is past EOF. Check nonempty ranges against the file length first, including offset overflow. Empty reads keep their existing behavior. Part of #1392.

What is in it

  • crates/xcl/src/hle/dstorage.rs: validate file ranges before allocation and test boundary, overflow and empty-read cases without fixtures.

Tested

  • Windows 11 Pro x64 build 26300, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT 16 GB, driver 32.0.32029.2010; Rust 1.98.1 MSVC, debug.
  • cargo test -p xcl --lib file_ranges_reject_truncation_and_offset_overflow: 1 passed, 0 failed.
  • cargo test --workspace -- --test-threads=4 --nocapture: 752 passed, 0 failed, 41 ignored. The reported passes include tests that return early.
  • SKIPPED: test_title_draws_with_a_root_signature_under_the_debug_layer and uploads_start_from_each_subresources_state (D3D12 debug layer unavailable).

Regression run

  • Retail smoke runs pending human verification.

main: not run

PR: not run

Not tested

  • Retail title, debug-layer validation, concurrent file growth, and performance impact of the metadata query added for each nonempty file request. This does not cover memory-source or physical-page allocation paths from #1392.

AI use

  • Codex (GPT-6): wrote implementation and unit tests, ran validation, and drafted this description.
**@⁠hajduzsolt** on GitHub · 2026-11-24 15:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/1427) `hajduzsolt:fix/dstorage-file-range-check` → `main` · +21 −0 · 1 files · 1 commits · closed without merging A file-source request allocates its staging buffer before discovering that the requested range is past EOF. Check nonempty ranges against the file length first, including offset overflow. Empty reads keep their existing behavior. Part of #1392. **What is in it** - `crates/xcl/src/hle/dstorage.rs`: validate file ranges before allocation and test boundary, overflow and empty-read cases without fixtures. **Tested** - Windows 11 Pro x64 build 26300, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT 16 GB, driver 32.0.32029.2010; Rust 1.98.1 MSVC, debug. - `cargo test -p xcl --lib file_ranges_reject_truncation_and_offset_overflow`: 1 passed, 0 failed. - `cargo test --workspace -- --test-threads=4 --nocapture`: 752 passed, 0 failed, 41 ignored. The reported passes include tests that return early. - SKIPPED: `test_title_draws_with_a_root_signature_under_the_debug_layer` and `uploads_start_from_each_subresources_state` (D3D12 debug layer unavailable). **Regression run** - [ ] Retail smoke runs pending human verification. main: not run PR: not run **Not tested** - Retail title, debug-layer validation, concurrent file growth, and performance impact of the metadata query added for each nonempty file request. This does not cover memory-source or physical-page allocation paths from #1392. **AI use** - Codex (GPT-6): wrote implementation and unit tests, ran validation, and drafted this description.
Check nonempty file source ranges before allocating staging memory, including offset overflow.

Co-Authored-By: Codex GPT-6 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:53:31 +00:00
github-bot closed this pull request 2026-11-26 04:53:31 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.