hle: bounds-check audio notifications/pump, guard xg::tiling null out, and clear stale xmem::arrange owner #494

Open
ahmetbagci8 wants to merge 1 commit from upstream-pr/494 into main
ahmetbagci8 commented 2026-12-01 17:11:33 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by ahmetbagci8 on 2026-12-01T17:11:33Z.


Rebuilt on the new main line (per #468) consolidating our previously reviewed HLE fixes (#437, #460, #461):

Fixes

  1. udio.rs (submit, pump):
    • Require 4-byte alignment and full 4-byte bounds via heap_bytes(notification, size_of::()) instead of 1-byte heap_unmap before write_volatile(1).
    • Use checked_add + u32::try_from in pump() instead of truncating ddress as u32.
  2. xg.rs ( iling):
    • Guard !out.is_null() before writing SubresourceTiling entries and report the available count in *n when out is null.
  3. xmem.rs (rrange):
    • Remove the stale have entry from owner in the else branch when want has no current owner.

Verification

  • cargo test -p vice-tay-hle --lib -- audio::tests xg::tests xmem::tests::the_32_bit_heap (29 passed, 0 failed)
  • cargo clippy -p vice-tay-hle --tests (0 warnings)
<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5590648740 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/494). Originally posted by [ahmetbagci8](https://github.com/ahmetbagci8) on 2026-12-01T17:11:33Z. --- Rebuilt on the new main line (per #468) consolidating our previously reviewed HLE fixes (#437, #460, #461): ## Fixes 1. **udio.rs (submit, pump):** - Require 4-byte alignment and full 4-byte bounds via heap_bytes(notification, size_of::<u32>()) instead of 1-byte heap_unmap before write_volatile(1). - Use checked_add + u32::try_from in pump() instead of truncating ddress as u32. 2. **xg.rs ( iling):** - Guard !out.is_null() before writing SubresourceTiling entries and report the available count in *n when out is null. 3. **xmem.rs (rrange):** - Remove the stale have entry from owner in the else branch when want has no current owner. ## Verification - cargo test -p vice-tay-hle --lib -- audio::tests xg::tests xmem::tests::the_32_bit_heap (29 passed, 0 failed) - cargo clippy -p vice-tay-hle --tests (0 warnings)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/494:upstream-pr/494'
git switch 'upstream-pr/494'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/494'
git switch 'upstream-pr/494'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/494'
git switch 'upstream-pr/494'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/494'
git switch 'main'
git merge --squash 'upstream-pr/494'
git switch 'main'
git merge --ff-only 'upstream-pr/494'
git switch 'main'
git merge 'upstream-pr/494'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
TaynanGT/Vice-Tay!494
No description provided.