CONFIG_RELOCATABLE and CONFIG_KASAN cannot be enabled at the same time
on ppce500 fsl_booke. All functions called before kasan_early_init()
should be disabled with kasan check. When CONFIG_RELOCATABLE is enabled
on ppce500 fsl_booke, relocate_init() is called before kasan_early_init()
which triggers kasan check and results in boot failure.
Call trace and functions which triggers kasan check(*):
- _start
- set_ivor
- relocate_init(*)
- early_get_first_memblock_info(*)
- of_scan_flat_dt(*)
...
- kasan_early_init
Potential solutions could be 1. implement relocate_init and all its children
function in a seperate file or 2. introduce a global vairable in KASAN, only
enable KASAN check when init is done.
Disable KASAN when RELOCATABLE is selected on fsl_booke for now until
it is supported.
Signed-off-by: Lexi Shao <redacted>
---
arch/powerpc/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
CONFIG_RELOCATABLE and CONFIG_KASAN cannot be enabled at the same time
on ppce500 fsl_booke. All functions called before kasan_early_init()
should be disabled with kasan check. When CONFIG_RELOCATABLE is enabled
on ppce500 fsl_booke, relocate_init() is called before kasan_early_init()
which triggers kasan check and results in boot failure.
Call trace and functions which triggers kasan check(*):
- _start
- set_ivor
- relocate_init(*)
- early_get_first_memblock_info(*)
- of_scan_flat_dt(*)
...
- kasan_early_init
Potential solutions could be 1. implement relocate_init and all its children
function in a seperate file or 2. introduce a global vairable in KASAN, only
enable KASAN check when init is done.
Solution 1 seems uneasy. of_scan_flat_dt() and children are general
functions that can't be set aside.
Solution 2 would destroy performance, and would anyway not work with
inline instrumentation.
Have you tried moving the call to kasan_early_init() before the call of
relocate_init() ?
On other PPC32, kasan_early_init() is the first thing done after
activating the MMU. But AFAIU, MMU is always active on BOOKE though.
Christophe
quoted hunk
Disable KASAN when RELOCATABLE is selected on fsl_booke for now until
it is supported.
Signed-off-by: Lexi Shao <redacted>
---
arch/powerpc/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
CONFIG_RELOCATABLE and CONFIG_KASAN cannot be enabled at the same time
on ppce500 fsl_booke. All functions called before kasan_early_init()
should be disabled with kasan check. When CONFIG_RELOCATABLE is enabled
on ppce500 fsl_booke, relocate_init() is called before kasan_early_init()
which triggers kasan check and results in boot failure.
Call trace and functions which triggers kasan check(*):
- _start
- set_ivor
- relocate_init(*)
- early_get_first_memblock_info(*)
- of_scan_flat_dt(*)
...
- kasan_early_init
Potential solutions could be 1. implement relocate_init and all its
children
function in a seperate file or 2. introduce a global vairable in
KASAN, only
enable KASAN check when init is done.
Solution 1 seems uneasy. of_scan_flat_dt() and children are general
functions that can't be set aside.
Solution 2 would destroy performance, and would anyway not work with
inline instrumentation.
Have you tried moving the call to kasan_early_init() before the call of
relocate_init() ?
I just tried it with QEMU, it works. I'll send a patch out soon.
Christophe
On other PPC32, kasan_early_init() is the first thing done after
activating the MMU. But AFAIU, MMU is always active on BOOKE though.
Christophe
quoted
Disable KASAN when RELOCATABLE is selected on fsl_booke for now until
it is supported.
Signed-off-by: Lexi Shao <redacted>
---
arch/powerpc/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)