commit | d61b8ea8210596600555176a3fada733c8b6d013 | [log] [tgz] |
---|---|---|
author | Thurston Dang <thurston@google.com> | Wed Mar 20 11:04:52 2024 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Mar 20 11:06:13 2024 -0700 |
tree | cebf35d7d6a3f57460c104a2e75929f184189fc1 | |
parent | 5f1762ff2440e97083562c2141b9ecf186f87418 [diff] |
[dfsan] Re-exec with no ASLR if memory layout is incompatible on Linux (#85674) DFSan's shadow mappings are incompatible with 32 bits of ASLR entropy ('sudo sysctl vm.mmap_rnd_bits=32; ninja check-dfsan') and it is difficult to fix this via increasing the size of the shadow mappings, due to the overhead of shadow memory. This patch works around the issue by detecting if the memory layout is incompatible, and if so, re-exec'ing without ASLR. DFSan and MSan share copy-pasted shadow memory code, hence this workaround is ported from MSan: - "[msan] Re-exec with no ASLR if memory layout is incompatible on Linux" (https://github.com/llvm/llvm-project/commit/58f7251820b14c93168726a24816d8a094599be5) - "[msan] Add 'MappingDesc::ALLOCATOR' type and check it is available" (https://github.com/llvm/llvm-project/commit/af2bf86a372cacf5f536bae06e2f2d3886eefb7b) (which in turn are inspired by TSan: "Re-exec TSan with no ASLR if memory layout is incompatible on Linux" (https://github.com/llvm/llvm-project/commit/0784b1eefa36d4acbb0dacd2d18796e26313b6c5 )) aeubanks had remarked in https://github.com/llvm/llvm-project/pull/85142#issuecomment-2004442883 that this issue occurs in Chromium: https://ci.chromium.org/ui/p/chromium/builders/try/linux_upload_clang/5066/overview GitOrigin-RevId: 62ed009ce218897d7707144de54fa1e2beec59dc