-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
executor: always mmap input_data #3466
Conversation
I only tested on OpenBSD which (just like linux) defines |
dbd3b55
to
4e69016
Compare
There was a problem hiding this 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.
The ci failures look related. |
59fae53
to
7467d2c
Compare
b3c64d0
to
ff5833e
Compare
This should now be ready for review. |
Is this fixing an actual issue on OpenBSD or just a refactoring/cleanup?
__attribute__((section(".openbsd.mutable"))) circumvents mimmutable on
OpenBSD and I cannot see anything wrong with the current mmap
invocation.
|
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'ing over bss is asking for trouble and openbsd delivered them with mimmutable changes.