App: reject wrapping RVAs in VICTORY_WATCH #482

Open
github-bot wants to merge 1 commit from github-bot/gh-482 into main AGit
Owner

@⁠enzoduarte1 on GitHub · 2026-11-24 03:55 UTC · original
enzoduarte1:app/watch-rva-overflow → main · +20 −5 · 1 files · 1 commits · open

What

watch() parsed each VICTORY_WATCH RVA as hex and checked it with rva + 4 <= size. On x86_64 a value like ffffffffffffffff wraps to 3, passes the check, and makes the polling thread read at base - 1 instead of inside the image. The neighboring VICTORY_CRASH_SAVE parser already uses checked_add.

The bounds check now uses checked_add, and the parsing lives in a watch_rvas helper that can be tested without reading an image. The test covers a wrapping RVA and the normal accepted/rejected boundary.

Tested

  • Windows 11, Rust 1.98.1, 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-existing xmem.rs warning fixed by PR #355, which was allowed locally.
  • rustfmt --edition 2024 --check apps/victory/src/run.rs and git diff --check: clean.
  • cargo xtask policy: 151 files ok. No game files or data taken from them were added.
  • Not tested: cargo test -p victory-loader --test load_probe. Its fixture passes MSVC's /DELAYLOAD flag, which MinGW rejects here; the same failure occurs on unmodified main.

Checklist

  • cargo fmt, cargo clippy --workspace --all-targets and cargo test --workspace pass — see the toolchain limitations above; the changed target is clean.
  • cargo xtask policy passes. The change adds no game files or data taken from them (docs/asset-policy.md).
  • If an AI tool wrote part of this change, the description says so: an AI tool assisted with the code and test; I reviewed and ran them.
**@⁠enzoduarte1** on GitHub · 2026-11-24 03:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/482) `enzoduarte1:app/watch-rva-overflow` → `main` · +20 −5 · 1 files · 1 commits · open ## What `watch()` parsed each `VICTORY_WATCH` RVA as hex and checked it with `rva + 4 <= size`. On x86_64 a value like `ffffffffffffffff` wraps to `3`, passes the check, and makes the polling thread read at `base - 1` instead of inside the image. The neighboring `VICTORY_CRASH_SAVE` parser already uses `checked_add`. The bounds check now uses `checked_add`, and the parsing lives in a `watch_rvas` helper that can be tested without reading an image. The test covers a wrapping RVA and the normal accepted/rejected boundary. ## Tested - Windows 11, Rust 1.98.1, `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-existing `xmem.rs` warning fixed by PR #355, which was allowed locally. - `rustfmt --edition 2024 --check apps/victory/src/run.rs` and `git diff --check`: clean. - `cargo xtask policy`: 151 files ok. No game files or data taken from them were added. - Not tested: `cargo test -p victory-loader --test load_probe`. Its fixture passes MSVC's `/DELAYLOAD` flag, which MinGW rejects here; the same failure occurs on unmodified `main`. ## Checklist - [ ] `cargo fmt`, `cargo clippy --workspace --all-targets` and `cargo test --workspace` pass — see the toolchain limitations above; the changed target is clean. - [x] `cargo xtask policy` passes. The change adds no game files or data taken from them (`docs/asset-policy.md`). - [x] If an AI tool wrote part of this change, the description says so: an AI tool assisted with the code and test; I reviewed and ran them.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:05:37 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:20 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 00:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/482#issuecomment-7148403361) <!-- victory-triage v1 head=c91e6b6b20e3f9e4561286a7e23fb1c196397df9 verdict=needs-rebase at=2026-11-25T00:13:20Z --> 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](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • apps/victory/src/run.rs
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.
git fetch -u origin '+refs/pull/482/head:github-bot/gh-482'
git switch 'github-bot/gh-482'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-482'
git switch 'github-bot/gh-482'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-482'
git switch 'github-bot/gh-482'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-482'
git switch 'main'
git merge --squash 'github-bot/gh-482'
git switch 'main'
git merge --ff-only 'github-bot/gh-482'
git switch 'main'
git merge 'github-bot/gh-482'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!482
No description provided.