mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-17 21:32:48 +00:00
UserspaceEmulator: Never try to mprotect(PROT_EXEC) MmapRegion backing
We never want to map host memory executable anyway, so let's always mask off the PROT_EXEC bit.
This commit is contained in:
parent
9588f01739
commit
b940dd4fa8
|
@ -242,7 +242,10 @@ void MmapRegion::set_prot(int prot)
|
|||
set_writable(prot & PROT_WRITE);
|
||||
set_executable(prot & PROT_EXEC);
|
||||
if (m_file_backed) {
|
||||
mprotect(m_data, size(), prot);
|
||||
if (mprotect(m_data, size(), prot & ~PROT_EXEC) < 0) {
|
||||
perror("MmapRegion::set_prot: mprotect");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue