Home
last modified time | relevance | path

Searched hist:"83 d0edee5217737e96ac6f0b9635afbbd5d795a2" (Results 1 – 2 of 2) sorted by relevance

/optee_os/.github/workflows/
H A Dci.yml83d0edee5217737e96ac6f0b9635afbbd5d795a2 Fri Aug 25 12:25:47 UTC 2023 Jerome Forissier <jerome.forissier@linaro.org> core: asan: KASAN and ASLR are incompatible

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 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>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
/optee_os/mk/
H A Dconfig.mk83d0edee5217737e96ac6f0b9635afbbd5d795a2 Fri Aug 25 12:25:47 UTC 2023 Jerome Forissier <jerome.forissier@linaro.org> core: asan: KASAN and ASLR are incompatible

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 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>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>