mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 07:46:01 +03:00
[PR #2232] [MERGED] Fix heap read after free in UnmapMemoryImpl #2582
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#2582
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/2232
Author: @hspir404
Created: 1/24/2025
Status: ✅ Merged
Merged: 1/24/2025
Merged by: @georgemoralis
Base:
main← Head:fix-unmap-memory-stale-read📝 Commits (1)
595078dFix stale heap read in UnmapMemoryImpl📊 Changes
1 file changed (+3 additions, -2 deletions)
View changed files
📝
src/core/memory.cpp(+3 -2)📄 Description
This doesn't fix any known behavior, but it fixes a read after free.
new_itcan become invalidated inMergeAdjacent, and the known safe iterator is returned from the function. The old code was discarding that new iterator, and continuing to access memory of the (potentially merged and potentially deleted) data.The read of
vma.protwas hanging my debugger (w/ the aggressive debug assertion settings I had enabled in Application Verifier).I'm not sure what significance the
readonly_filevariable/parameter has here, but it had a chance of being inaccurate before this change.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.