diff --git a/LibELF/LibELF/LoadableELF.cpp b/LibELF/LibELF/LoadableELF.cpp index d25860bd8..106c31420 100644 --- a/LibELF/LibELF/LoadableELF.cpp +++ b/LibELF/LibELF/LoadableELF.cpp @@ -252,6 +252,9 @@ namespace LibELF break; case PT_LOAD: { + if (!(program_header.p_flags & LibELF::PF_W)) + continue; + PageTable::flags_t flags = PageTable::Flags::UserSupervisor | PageTable::Flags::Present; if (program_header.p_flags & LibELF::PF_W) flags |= PageTable::Flags::ReadWrite;