Shaders: reject DXBC part offsets inside the header or part table #3251
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!3251
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3251"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 14:38 UTC · original
andrewpozdnakov7-jpg:fix/777-dxbc-part-offsets→main· +33 −0 · 1 files · 1 commits · openContainer::parsereads each part offset from the table and uses it without checking that it lies past the header and the table itself. An offset of 0 reads the container magic back as a part FourCC (DXBC), and an offset inside the table reads neighbour entries as a part header.The table has to fit inside the container, and every part now has to start at or after
HEADER_SIZE + 4 * count. Anything earlier isMalformed("part offset inside the header or part table").rejects_part_offsets_inside_the_header_or_tablecovers offset 0 and an offset landing inside the table;cargo test -p victory-shader --lib dxbc: 3 passed.victory-shadersuite with app-local WARP SM 6.6 and active DXIL validation: 300 passed, 3 failed, 3 ignored. The same three fail on63bcca4without this change (299 passed, 3 failed, 3 ignored):wave64_permutes_stay_within_each_32_lane_half,permutes_read_the_lane_named_and_zero_from_lanes_left_out,edge_flagged_triangles_draw_as_unflagged_ones, allwarpassertions this machine produces.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 192 files ok.Valid containers are unaffected: every real part starts after the table, which the round-trip test keeps covering.
Fixes #777.
@Dukestar69 on GitHub · 2026-11-26 14:49 UTC · original · approved these changes
Reviewed the diff and verified locally on Windows 11 x64:
ejects_part_offsets_inside_the_header_or_table).
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.