xmem: check n * PAGE and base + len overflow in XMemMapPhysicalPages (#224) #247
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!247
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-247"
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?
@ending3729 on GitHub · 2026-11-26 12:38 UTC · original
ending3729:fix/xmem-map-physical-pages-overflow→main· +21 −2 · 1 files · 1 commits · openFixes #224.
What changed
crates/victory-hle/src/modules/xmem.rs: inXMemMapPhysicalPages, checkn.checked_mul(PAGE)andbase.checked_add(len)beforestd::slice::from_raw_parts(pages, n)andunmap, returning null on overflow.crates/victory-hle/src/modules/xmem.rs: inunmap, checkbase.checked_add(len)soendcannot wrap.modules::xmem::tests::map_physical_pages_rejects_overflowing_count_and_end(verified failing before the fix and passing after).Tested
cargo test -p victory-hle --locked: 156 passed, 0 failed, 2 ignored;no_dll_planting: 1 passed, 0 failedcargo test -p xtask --locked: 9 passed, 0 failedcargo clippy -p victory-hle --all-targets --locked --no-deps -- -D warnings: 0 warningsAI use
@lerapeurdu62280-debug on GitHub · 2026-11-26 14:16 UTC · original · approved these changes
Read the diff. checked_mul/checked_add before from_raw_parts and in unmap close a real wrap on title-supplied n/address, and the test covers both the count and the end overflow.
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.