Kernel.Vmm: Fix protection check for file mappings (#4388)

This commit is contained in:
Stephen Miller 2026-05-09 18:09:51 -05:00 committed by GitHub
parent 05ccc586ff
commit d3597c7f18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -702,7 +702,7 @@ s32 MemoryManager::MapFile(void** out_addr, VAddr virtual_addr, u64 size, Memory
handle = file->f.GetFileMapping(); handle = file->f.GetFileMapping();
if (False(file->f.GetAccessMode() & Common::FS::FileAccessMode::Write) || if (False(file->f.GetAccessMode() & Common::FS::FileAccessMode::Write) &&
False(file->f.GetAccessMode() & Common::FS::FileAccessMode::Append)) { False(file->f.GetAccessMode() & Common::FS::FileAccessMode::Append)) {
// If the file does not have write access, ensure prot does not contain write // If the file does not have write access, ensure prot does not contain write
// permissions. On real hardware, these mappings succeed, but the memory cannot be // permissions. On real hardware, these mappings succeed, but the memory cannot be