App: reject wrapping RVAs in VICTORY_WATCH #482
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/482"
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?
Imported from Marvisak/VIctory. Originally posted by enzoduarte1 on 2026-11-24T03:55:52Z.
What
watch()parsed eachVICTORY_WATCHRVA as hex and checked it withrva + 4 <= size. On x86_64 a value likeffffffffffffffffwraps to3, passes the check, and makes the polling thread read atbase - 1instead of inside the image. The neighboringVICTORY_CRASH_SAVEparser already useschecked_add.The bounds check now uses
checked_add, and the parsing lives in awatch_rvashelper that can be tested without reading an image. The test covers a wrapping RVA and the normal accepted/rejected boundary.Tested
x86_64-pc-windows-gnu(no MSVC linker on this machine).cargo test -p victory --features diagnostics --bin victory run::: 2 passed.cargo test --workspace --exclude victory-loader -- --test-threads=1: all suites passed.cargo clippy -p victory --all-targets --features diagnostics -- -D warnings: clean here, apart from the pre-existingxmem.rswarning fixed by PR #355, which was allowed locally.rustfmt --edition 2024 --check apps/victory/src/run.rsandgit diff --check: clean.cargo xtask policy: 151 files ok. No game files or data taken from them were added.cargo test -p victory-loader --test load_probe. Its fixture passes MSVC's/DELAYLOADflag, which MinGW rejects here; the same failure occurs on unmodifiedmain.Checklist
cargo fmt,cargo clippy --workspace --all-targetsandcargo test --workspacepass — see the toolchain limitations above; the changed target is clean.cargo xtask policypasses. The change adds no game files or data taken from them (docs/asset-policy.md).Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T08:03:14Z.
Review: APPROVED
Tested
c91e6b6on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (264 passed, 0 failed). The new test only builds with--features diagnostics, andcargo test -p victory --features diagnostics --bin victory watch_rejectspasses.The bug is real.
rva + 4wraps forusize::MAX, soffff…ffpassed the bound and the poller would have read atbase - 1.checked_add(4).is_some_and(|end| end <= size)fixes it and keeps the exact-fit boundary (0x1cwith size0x20is accepted). Moving the parse intowatch_rvasbehind the samecfgkeeps release builds unchanged.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:20:15Z.
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:apps/victory/src/run.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.