mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[PR #3989] [MERGED] Fix address space wrapping in Rasterizer::IsMapped causing incorrect return #3850
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3850
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/3989
Author: @Dasaav-dsv
Created: 2/2/2026
Status: ✅ Merged
Merged: 2/2/2026
Merged by: @georgemoralis
Base:
main← Head:fix/mapped-address-wrapping📝 Commits (1)
b128022PreventRasterizer::IsMappedfrom returningtruefor memory ranges that wrap the address space📊 Changes
1 file changed (+4 additions, -0 deletions)
View changed files
📝
src/video_core/renderer_vulkan/vk_rasterizer.cpp(+4 -0)📄 Description
This PR adds a simple overflow check.
Explanation:
If
addr + sizeoverflow (and wrap),boost::icl::containswon't return an expected result for an interval where the left side is greater than the right side. This can cause an address size pair like0xffffffffffffffff, 8to be reported as mapped and causing an OOB access down the line when the page table is indexed with the address high bits. This would normally lead to a crash anyway, but with the wrapping bug present it will instead crash the shadPS4 liverpool thread, which is annoying for debugging.How could this happen?
When a non-canonical memory address is accessed, an access violation is raised. However, instead of the address itself,
ExceptionInformation[1]may be set to0xffffffffffffffffinstead in the exception handler. I can't really find a source where this is documented (so trust me ™).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.