-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
vm.mmap_rnd_bits=32 cause issues for MSAN, LSAN and ASAN #1614
Comments
As of April 2023 (https://reviews.llvm.org/D148280, https://reviews.llvm.org/D148193), 32-bits of entropy shouldn't be a problem for ASan and LSan anymore (they support 32 bits of entropy on x86-64 and 33 bits on aarch64). |
As of January 2024, TSan will re-exec without ASLR if the entropy is too high: llvm/llvm-project@0784b1e (it is difficult to support higher entropy due to pointer compression and the overhead of shadow mappings). |
to get MSan jobs to work with the latest Ubuntu images. google/sanitizers#1614 actions/runner-images#9491
to get MSan jobs to work with the latest Ubuntu images. google/sanitizers#1614 actions/runner-images#9491
vm.mmap_rnd_bits has been recently changed to 32 on GHA, which triggers issues in ASAN builds that spuriously fail on startup. The fix requires a more recent clang/gcc than the agents have available (clang 17, not sure what GCC version), so for now we need to work around this by restricting the ASLR randomness. See google/sanitizers#1614
### Briefly, what does this PR introduce? This PR sets vm.mmap_rnd_bits=28 to get around the issues in: - actions/runner#3207 - google/sanitizers#1614 ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No.
### Briefly, what does this PR introduce? This PR sets vm.mmap_rnd_bits=28 to get around the issues in: - actions/runner#3207 - google/sanitizers#1614 ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No.
AFAIU, MSan has also fixed in development, see llvm/llvm-project#85142. Just for anyone who comes across this: This issue creates some fallout for sanitizers on Github Actions, see google/oss-fuzz#11708 (comment) for an analysis. |
Thanks for pointing this out! I forgot to update this issue. In related news, there is an analogous patch pending review for DFSan: llvm/llvm-project#85674 |
Patch for memprof landed: llvm/llvm-project#85834 |
As of today, all the following sanitizers in mainline LLVM can run with In the meantime, please reduce the ASLR entropy (
At lower ASLR entropy settings (or if they get "lucky" with the randomized layout at higher entropy settings), they will run with ASLR enabled. (TSan/MSan/DFSan have much higher shadow memory overhead than ASan/LSan/HWASan/memprof, making it difficult to create shadow mappings that can support 32 bits of ASLR.) |
to get MSan jobs to work with the latest Ubuntu images. google/sanitizers#1614 actions/runner-images#9491
The MSan fix has been backported to the llvm 18.x branch (release pending): llvm/llvm-project@c2a5703 |
to get MSan jobs to work with the latest Ubuntu images. google/sanitizers#1614 actions/runner-images#9491
### Briefly, what does this PR introduce? This PR sets vm.mmap_rnd_bits=28 to get around the issues in: - actions/runner#3207 - google/sanitizers#1614 ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No.
Hoping this will fix MSan in CI, since it picks up the change in google/sanitizers#1614 (comment) Change-Id: Iab62caed53ec1d0e9fb1bb39b55af420f9c08c75 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/69130 Reviewed-by: Bob Beck <bbe@google.com>
Command to generate a minimal program for test
For ASAN on gcc, it will output
AddressSanitizer:DEADLYSIGNAL
repetedly.For MSAN on clang, it will output the following
For LSAN on both gcc and clang, and ASAN on clang, it will only output
Segmentation fault
.It not all the time, but about 4 out of 10 times.
What worth noting is that it happens only when vm.mmap_rnd_bits=32, not any other value between 28 to 31.
Testing on Debian testing with gcc version
and clang version
The text was updated successfully, but these errors were encountered: