Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Review] core: asan: KASAN and ASLR are incompatible
When squashing I will replace the commit message with the following: The address sanitizer shadow offset address is given at compile time (CFG_ASAN_SHADOW_OFFSET) and is hard-coded by the compiler into the prologue of instrumented functions, for the purpose of initializing the shadow area for the stack (local variables). With ASLR turned on, this offset becomes invalid because of the random ASLR offset. For KASAN to work with ASLR, we would need to either keep the shadow area at the expected offset (which is may not be very easy, I have not investigated in more details) or provide the shadow offset dynamically. An attempt was made three years ago to extend the GCC compiler with such a feature [1] but there was no feedback from the maintainers [2]. Add a check in mk/config.mk so that KASAN and ASLR may not be enabled simultaneously. Link: https://blogs.coreboot.org/blog/2020/08/31/gsoc-address-sanitizer-wrap-up/ [1] Link: https://gcc.gnu.org/pipermail/gcc-patches/2020-July/550176.html [2] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
- Loading branch information