xtensa: add support for KASAN
Cover kernel addresses above 0x90000000 by the shadow map. Enable HAVE_ARCH_KASAN when MMU is enabled. Provide kasan_early_init that fills shadow map with writable copies of kasan_zero_page. Call kasan_early_init right after mmu initialization in the setup_arch. Provide kasan_init that allocates proper shadow map pages from the memblock and puts these pages into the shadow map for addresses from VMALLOC area to the end of KSEG. Call kasan_init right after memblock initialization. Don't use KASAN for the boot code, MMU and KASAN initialization and page fault handler. Make kernel stack size 4 times larger when KASAN is enabled to avoid stack overflows. GCC 7.3, 8 or newer is required to build the xtensa kernel with KASAN. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
@@ -31,7 +31,8 @@
|
||||
*/
|
||||
|
||||
.text
|
||||
ENTRY(memset)
|
||||
ENTRY(__memset)
|
||||
WEAK(memset)
|
||||
|
||||
entry sp, 16 # minimal stack frame
|
||||
# a2/ dst, a3/ c, a4/ length
|
||||
@@ -140,7 +141,7 @@ EX(10f) s8i a3, a5, 0
|
||||
.Lbytesetdone:
|
||||
retw
|
||||
|
||||
ENDPROC(memset)
|
||||
ENDPROC(__memset)
|
||||
|
||||
.section .fixup, "ax"
|
||||
.align 4
|
||||
|
Reference in New Issue
Block a user