GPU: a plain heap description is not read past its 16 bytes without checking they are mapped #2278
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2278
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2278"
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?
@denkencar-sketch on GitHub · 2026-11-25 09:29 UTC · original
denkencar-sketch:fix/desc-001→main· +50 −3 · 1 files · 1 commits · openSummary
A plain heap description was read past its 16 bytes without checking they are mapped, so an older title's description at the end of its memory faulted. The placement of a newer title's extended description is now read through the kernel.
Testing
Test
a_plain_description_at_the_end_of_mapped_memory_is_read_wholecrashes (0xc0000005) onmainand passes with this change.cargo test --workspace --lockedpasses apart from the known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).Not tried: the non-Windows path (unchanged), and a run in the game.
AI-assisted.
@DesertGamer on GitHub · 2026-11-25 09:37 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@Marvisak on GitHub · 2026-11-25 13:32 UTC · original · edited 2026-11-26 01:25 UTC
Automated triage for the maintainers.
Merge candidate. Rebased onto current
main, one commit, merges cleanly.In
crates/victory-gpu/src/descriptor.rs,create_heapused to read the 16 bytes after a plain heap description directly, as a possible extended placement. It now reads them throughplacement_after, which on Windows usescrate::host::read_into(ReadProcessMemoryon the current process, already used elsewhere in the crate) and returns a zero placement when those bytes are not readable. A zero placement is not mistaken for an extended one, because recognition requires its size to match the count.a_plain_description_at_the_end_of_mapped_memory_is_read_wholeputs the description at the end of a page followed by aPAGE_NOACCESSpage, and checks that the heap is created instead of faulting. Nit: the non-Windows branch'sSAFETY: as aboveno longer has a safety comment above it to refer to.CI: passing (
check). Recommending a look, not approving.Generated by Claude Code
@catminou4 on GitHub · 2026-11-25 09:35 UTC · original · reviewed
A plain heap description is not read past its 16 bytes: placement_after() probes with read_into on Windows instead of a blind unaligned read. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Defensive fix for titles passing stack/data as HeapDesc; the non-Windows fallback still does the blind read (noted, Windows-only crate anyway).
@DenRakEiw on GitHub · 2026-11-25 09:42 UTC · original · approved these changes
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):cargo test -p victory-gpu --lib descriptor::tests::— 6 passed, 0 failed (includinga_plain_description_at_the_end_of_mapped_memory_is_read_whole)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean mapped-memory guard preventing out-of-bounds reads past 16-byte plain
HeapDescstructs. Looks good.AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 15:54 UTC · original · approved these changes
Reviewed
0d92d58a02c0aa1dd6b57cb1f955bc2addbb6ac6(merged cleanly onto63bcca43c6a00a758510398fa43096ce7e4f7df0) and verified on Windows 11 with an NVIDIA GeForce RTX 5090, WARP, and D3D12 Debug Layer.Audit
crates/victory-gpu/src/descriptor.rs:740,:744,:772:placement_afterprobes the 16 bytes followingHeapDescthroughcrate::host::read_into(desc_ptr.wrapping_add(1).cast(), &mut bytes)on Windows and falls back to a zeroPlacementwhen unreadable, preventing access violations when a plain 16-byteHeapDescends at or near aPAGE_NOACCESSboundary while decoding valid 32-byte extendedHeapDesc + Placementrecords identically. Non-Windows fallback compiles cleanly under#[cfg(not(windows))].Verification
63bcca43c6a00a758510398fa43096ce7e4f7df0+cargo run -p xtask -- policy(191 files ok)cargo clippy -p victory-gpu --all-targets -- -D warnings(default &--all-features)victory-gpuwithVICTORY_D3D12_DEBUG=1:descriptor::tests::8/8 passed on RTX 5090; fulldescriptor::23/23 passed (--features diagnostics) on WARP (includinga_plain_description_at_the_end_of_mapped_memory_is_read_whole).HeapDescplaced atpage + 4096 - 24(with only 8 mapped bytes of non-zero data beforePAGE_NOACCESS) falls back cleanly without faulting or trusting partial bytes, and (2) a mapped 32-byte extendedHeapDesc + Placementis still recognized and honorsplacement.address.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.