Use a new %run wrapper for ASAN/MSAN/TSAN tests that calls paxctl
in order to disable ASLR on the test executables. This makes it
possible to test sanitizers on systems where ASLR is enabled by default.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Could this go into the common lit config in compiler-rt/test?
What is the problem with ASLR in NetBSD? Is this about fixed shadow location conflicts with the binary & library mappings?
Do you mean to run this for all tests in compiler-rt? We intend to disable it only when needed and prevent leaking regressions that violate ASLR to other components of LLVM.
What is the problem with ASLR in NetBSD? Is this about fixed shadow location conflicts with the binary & library mappings?
PaX ASLR on NetBSD is too aggressive with the layout randomization and we cannot predict ranges of the heap and the stack. Next, we cannot map reliably the memory used into shadow buffer that crashes in a cryptic way. We are fine with disabling ASLR for the sanitizers that need shadow buffers and origins.
compiler-rt/test/sanitizer_common/netbsd_commands/run_noaslr.sh | ||
---|---|---|
5 | I propose to use /usr/bin/paxctl as it will be PATH and environment independent. We already use this direct path approach in pkgsrc. |
I meant you could define this path in the common lit config as something like "netbsd_noaslr_prefix" and then set up the %run substitution in subdirectories.
PaX ASLR on NetBSD is too aggressive with the layout randomization and we cannot predict ranges of the heap and the stack. Next, we cannot map reliably the memory used into shadow buffer that crashes in a cryptic way. We are fine with disabling ASLR for the sanitizers that need shadow buffers and origins.
Sounds good.
Updated to pass the 'prefix' via config object from common, and to use full path for paxctl.
LGTM
compiler-rt/test/sanitizer_common/netbsd_commands/run_noaslr.sh | ||
---|---|---|
5 | It this path correct? /usr/sbin in the code vs /usr/bin in the comment. |
compiler-rt/test/sanitizer_common/netbsd_commands/run_noaslr.sh | ||
---|---|---|
5 | It is correct. I made a typo. |
I propose to use /usr/bin/paxctl as it will be PATH and environment independent. We already use this direct path approach in pkgsrc.