forked from luck/tmp_suning_uos_patched
c633544a61
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>
32 lines
825 B
Makefile
32 lines
825 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for some libs needed by zImage.
|
|
#
|
|
|
|
zlib := inffast.c inflate.c inftrees.c
|
|
|
|
lib-y += $(zlib:.c=.o) zmem.o
|
|
|
|
ccflags-y := -Ilib/zlib_inflate
|
|
ifdef CONFIG_FUNCTION_TRACER
|
|
CFLAGS_REMOVE_inflate.o = -pg
|
|
CFLAGS_REMOVE_zmem.o = -pg
|
|
CFLAGS_REMOVE_inftrees.o = -pg
|
|
CFLAGS_REMOVE_inffast.o = -pg
|
|
endif
|
|
|
|
KASAN_SANITIZE := n
|
|
|
|
CFLAGS_REMOVE_inflate.o += -fstack-protector -fstack-protector-strong
|
|
CFLAGS_REMOVE_zmem.o += -fstack-protector -fstack-protector-strong
|
|
CFLAGS_REMOVE_inftrees.o += -fstack-protector -fstack-protector-strong
|
|
CFLAGS_REMOVE_inffast.o += -fstack-protector -fstack-protector-strong
|
|
|
|
quiet_cmd_copy_zlib = COPY $@
|
|
cmd_copy_zlib = cat $< > $@
|
|
|
|
$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
|
|
$(call cmd,copy_zlib)
|
|
|
|
clean-files := $(zlib)
|