Repository navigation
Conversation
SB_C2DLEN and SB_PDLEN are set by the game, and nothing checks them against the memory they cover: - Ch2 to the TA: after the split at the end of RAM, the rest of the source can still be invalid (longer than RAM, or src stepped from the last area 3 mirror into area 4). GetMemPtr() then returns null and TAWrite() dereferences it. Skip the transfer and complete the DMA as usual. - Ch2 64-bit texture path: the RAM read is split at the end of RAM but the VRAM write isn't, so a long transfer copies past the end of VRAM. - PVR DMA: WriteMemBlock_nommu_dma() copies len bytes between RAM and VRAM with no bound on either side. Clamp the length to the end of the region. A valid transfer already fits, so only out-of-range lengths change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JoeMatt
force-pushed
the
fix/dma-length-bounds
branch
from
October 13, 2026 22:50
58ec0e3 to
a85b404
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SB_C2DLEN and SB_PDLEN are set by the game, and nothing checks them
against the memory they cover:
source can still be invalid (longer than RAM, or src stepped from the
last area 3 mirror into area 4). GetMemPtr() then returns null and
TAWrite() dereferences it. Skip the transfer and complete the DMA as
usual.
the VRAM write isn't, so a long transfer copies past the end of VRAM.
VRAM with no bound on either side.
Clamp the length to the end of the region. A valid transfer already
fits, so only out-of-range lengths change.
Testing: compiles in the libretro core and the standalone build (macOS arm64). Not run on content.
🤖 Generated with Claude Code