[PR #2918] [MERGED] Mprotect only over whole pages #3081

Closed
opened 2026-02-27 22:02:22 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2918
Author: @mikusp
Created: 5/12/2025
Status: Merged
Merged: 5/12/2025
Merged by: @squidbus

Base: mainHead: mprotect_alignment


📝 Commits (2)

  • b929ecf Mprotect only over whole pages
  • f331b5e Fix aligned_size error and clang-format.

📊 Changes

1 file changed (+7 additions, -3 deletions)

View changed files

📝 src/core/memory.cpp (+7 -3)

📄 Description

Resident Evil 2 calls mprotect with address not aligned to the page boundary, causing mprotect(2) to fail. On PS4 it seems mprotect silently aligns the parameters to 16kB pages


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2918 **Author:** [@mikusp](https://github.com/mikusp) **Created:** 5/12/2025 **Status:** ✅ Merged **Merged:** 5/12/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `mprotect_alignment` --- ### 📝 Commits (2) - [`b929ecf`](https://github.com/shadps4-emu/shadPS4/commit/b929ecf44eec78a20c0194249ed35b0e50f91e7f) Mprotect only over whole pages - [`f331b5e`](https://github.com/shadps4-emu/shadPS4/commit/f331b5e5d1bd8b8bf50b5a86595f0e5772c6c60f) Fix aligned_size error and clang-format. ### 📊 Changes **1 file changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/core/memory.cpp` (+7 -3) </details> ### 📄 Description Resident Evil 2 calls mprotect with address not aligned to the page boundary, causing mprotect(2) to fail. On PS4 it seems mprotect silently aligns the parameters to 16kB pages --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:02:22 +03:00
Sign in to join this conversation.
No milestone
No project
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
starred/shadPS4#3081
No description provided.