diff --git a/src/AddressSpace.cc b/src/AddressSpace.cc index 86b00445190..6b1b536facc 100644 --- a/src/AddressSpace.cc +++ b/src/AddressSpace.cc @@ -1646,7 +1646,7 @@ static void assert_segments_match(Task* t, const KernelMapping& input_m, err = "starts differ"; } else if (m.end() != km.end()) { err = "ends differ"; - } else if (m.prot() != km.prot()) { + } else if ((m.prot() ^ km.prot()) & KernelMapping::checkable_prot_mask) { err = "prots differ"; } else if ((m.flags() ^ km.flags()) & KernelMapping::checkable_flags_mask) { err = "flags differ"; diff --git a/src/AddressSpace.h b/src/AddressSpace.h index 1af47e580ba..2eae98a3b2a 100644 --- a/src/AddressSpace.h +++ b/src/AddressSpace.h @@ -56,6 +56,7 @@ class KernelMapping : public MemoryRange { MAP_PRIVATE | MAP_SHARED | MAP_STACK | MAP_GROWSDOWN; static const int checkable_flags_mask = MAP_PRIVATE | MAP_SHARED; + static const int checkable_prot_mask = PROT_READ | PROT_WRITE | PROT_EXEC; static const dev_t NO_DEVICE = 0; static const ino_t NO_INODE = 0;