XGameSave: validate container quota and sanitize blob URL encoding #1430
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1430
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1430"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@slopgobblercobbler on GitHub · 2026-11-24 15:53 UTC · original
slopgobblercobbler:fix/gamesave-quota-and-url-encoding→main· +230 −6 · 1 files · 1 commits · openSummary
Hardens XGameSave storage against malformed inputs, overlong names, quota overflow, and non-ASCII URL decoding panics:
crates/xcl/src/hle/xgameruntime/gamesave.rs):&file[i + 1..i + 3]string slicing indec()with byte-level ASCII hex validation (hex_val()), preventing UTF-8 character boundary slicing panics on filenames containing non-ASCII characters following%(e.g.%€,%ü) and rejecting non-hex characters.enc():is_reserved_device_name()extending DOS device protection to"CONIN$","CONOUT$", and"CLOCK$"alongside"CON","PRN","AUX","NUL","COM0-9", and"LPT0-9".valid_blob_name(&n): rejects empty names ("") and overlong names (> 1024 bytes) inXGameSaveSubmitBlobWrite,XGameSaveSubmitBlobDelete, andnames_ofwithE_INVALIDARG.GS_MAX_BLOB_SIZE = 16 << 20(16 MiB) inXGameSaveSubmitBlobWrite, returningE_GS_UPDATE_TOO_BIG(0x80830005).calculate_projected_quota()inapply()underSAVE_MUTATION: validates projected total across the provider root againstQUOTA(256 MiB), folding multiple operations per blob and netting existing on-disk sizes. ReturnsE_GS_QUOTA_EXCEEDED(0x80830006) atomically before modifying or deleting any files on disk.XGameSaveGetRemainingQuotawithSAVE_MUTATIONlock to prevent reading mid-mutation, and validated non-nullquotaout pointer inXGameSaveGetRemainingQuotaResultreturningE_INVALIDARG.Changes
crates/xcl/src/hle/xgameruntime/gamesave.rs:dec(): byte-level hex validation avoiding slice panic on non-ASCII characters.enc(): extended reserved Windows device name checks.apply(): atomic projected quota check before disk mutation.Tested
cargo test -p xcl -- gamesave: 14 passed, 0 failed (100% pass rate).Not Tested
AI Use
Co-Authored-By: Claude Code (Claude Opus 5.5) / Gemini Antigravity
@futurepro62 on GitHub · 2026-11-24 15:58 UTC · original · edited 2026-11-24 16:05 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
d820ec8(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 755 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.url_encoding_safety_dec_non_ascii_and_malformed_percent_does_not_panic,url_encoding_device_names_and_windows_specials,blob_name_bounds_and_empty_validation,container_quota_validation_enforces_limit_and_atomicity.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 755 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 18:52 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@Toons29 on GitHub · 2026-11-25 03:30 UTC · original
Regression run of
d820ec84on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 99 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.