Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only check for PROT_{READ,WRITE,EXEC} in assert_segments_match() #3768

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AddressSpace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions src/AddressSpace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading