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

executor: always mmap input_data #3466

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

blackgnezdo
Copy link
Collaborator

@blackgnezdo blackgnezdo commented Oct 24, 2022

mmap'ing over bss is asking for trouble and openbsd delivered them with mimmutable changes.

@blackgnezdo
Copy link
Collaborator Author

I only tested on OpenBSD which (just like linux) defines SYZ_EXECUTOR_USES_SHMEM. It'd be good for at least one of Akaros, Fuchsia, or Windows to test this.

Copy link
Collaborator

@dvyukov dvyukov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any issues with this. I think this is OK.

We randomize address of output region so that the test program does not corrupt it by guessing its address. But the input region is mapped as PROT_READ only (at least in shmem mode), so the test program shouldn't corrupt it.

There is potential concern of taking the address of the data region and locating input adjacent to the data region (which can affect kernel behavior wrt the data region in some ways). But the data region is already mapped at this point (in os_init). And at least on Linux we surround the data region with protected pages to avoid the effect of having something unpredictable around (thus changing behavior of the kernel in some corner cases). So this should not be an issue as well.

@dvyukov
Copy link
Collaborator

dvyukov commented Oct 24, 2022

The ci failures look related.

@blackgnezdo blackgnezdo force-pushed the always-mmap-input-data branch 2 times, most recently from 59fae53 to 7467d2c Compare October 25, 2022 05:43
@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Merging #3466 (ff5833e) into master (4564542) will not change coverage.
The diff coverage is n/a.

@blackgnezdo
Copy link
Collaborator Author

This should now be ready for review.

@blackgnezdo blackgnezdo merged commit afef4a4 into google:master Oct 25, 2022
@blackgnezdo blackgnezdo deleted the always-mmap-input-data branch October 25, 2022 16:40
@mptre
Copy link
Collaborator

mptre commented Oct 25, 2022 via email

@blackgnezdo
Copy link
Collaborator Author

This was triggered by MAP_FIXED being temporarily broken in OpenBSD. There's now less platform-specific special sauce when we stick to plain mmap instead of mapping over bss that needs to be magically marked to hide it from mimmutable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants