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
configure AC_FUNC_MMAP does not detect mmap #122
Comments
|
More of a CheriBSD issue than a cheribsd-ports issue, but I'll address it here. TL;DR: in order to preserve provenance and intentionality we greatly restrict the use of MAP_FIXED. You can likely just define ac_cv_func_mmap_fixed_mapped=yes when running configure to skip this test (we probably didn't notice this because the cheribsd_ports system already does this). The generated test tries something we've deliberately broken to avoid races and confusing runtime behavior. Specifically, the failing part of the code does approximately: On CheriBSD 22.12 this will attempt to perform a MAP_FIXED mapping using a tagged capability to a location with no existing mapping (despite the comment in the test implying there is one). We reject this because in the general case another thread could trigger an mmap between the This strips the provenance from the pointer (it will be untagged and metadata will be cleared) and works because we allow mappings at arbitrary addresses so long as nothing is there as a compatibility measure. On CheriBSD 23.11 this will fail for a slightly different reason. Because we have enabled heap temporal safety, after the In the end, I think the test is testing something people might care about, but I doubt it affects most Hopefully that longwinded writeup is somewhat informative. |
|
This will be fixed in autoconf 2.72e (https://lists.gnu.org/r/autoconf/2023-12/msg00026.html). The workaround is to set |
|
Thank you for the detailed explanation and the fix! |
|
I confirm autoconf 2.72e solves the issue. |
Not sure I'm reporting the issue in the proper space but
I found that AC_FUNC_MMAP in configure does reports that mmap() is not working.
Host: GCC farm cfarm240 (Morello CheriBSD/arm64)
autoreconf: v2.71
How to reproduce:
configure.ac content:
type:
autoreconf -i && ./configure
output (see "checking for working mmap..." line):
The text was updated successfully, but these errors were encountered: