mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-31 08:28:13 +00:00
893ab00439
Some Makefiles already pass -fno-stack-protector unconditionally. For example, arch/arm64/kernel/vdso/Makefile, arch/x86/xen/Makefile. No problem report so far about hard-coding this option. So, we can assume all supported compilers know -fno-stack-protector. GCC 4.8 and Clang support this option (https://godbolt.org/z/_HDGzN) Get rid of cc-option from -fno-stack-protector. Remove CONFIG_CC_HAS_STACKPROTECTOR_NONE, which is always 'y'. Note: arch/mips/vdso/Makefile adds -fno-stack-protector twice, first unconditionally, and second conditionally. I removed the second one. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
57 lines
1.8 KiB
Makefile
57 lines
1.8 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# Kernel does not boot with instrumentation of tlb.c and mem_encrypt*.c
|
|
KCOV_INSTRUMENT_tlb.o := n
|
|
KCOV_INSTRUMENT_mem_encrypt.o := n
|
|
KCOV_INSTRUMENT_mem_encrypt_identity.o := n
|
|
|
|
KASAN_SANITIZE_mem_encrypt.o := n
|
|
KASAN_SANITIZE_mem_encrypt_identity.o := n
|
|
|
|
# Disable KCSAN entirely, because otherwise we get warnings that some functions
|
|
# reference __initdata sections.
|
|
KCSAN_SANITIZE := n
|
|
|
|
ifdef CONFIG_FUNCTION_TRACER
|
|
CFLAGS_REMOVE_mem_encrypt.o = -pg
|
|
CFLAGS_REMOVE_mem_encrypt_identity.o = -pg
|
|
endif
|
|
|
|
obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o mmap.o \
|
|
pgtable.o physaddr.o setup_nx.o tlb.o cpu_entry_area.o maccess.o
|
|
|
|
obj-y += pat/
|
|
|
|
# Make sure __phys_addr has no stackprotector
|
|
CFLAGS_physaddr.o := -fno-stack-protector
|
|
CFLAGS_setup_nx.o := -fno-stack-protector
|
|
CFLAGS_mem_encrypt_identity.o := -fno-stack-protector
|
|
|
|
CFLAGS_fault.o := -I $(srctree)/$(src)/../include/asm/trace
|
|
|
|
obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o
|
|
|
|
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
|
|
obj-$(CONFIG_PTDUMP_CORE) += dump_pagetables.o
|
|
obj-$(CONFIG_PTDUMP_DEBUGFS) += debug_pagetables.o
|
|
|
|
obj-$(CONFIG_HIGHMEM) += highmem_32.o
|
|
|
|
KASAN_SANITIZE_kasan_init_$(BITS).o := n
|
|
obj-$(CONFIG_KASAN) += kasan_init_$(BITS).o
|
|
|
|
obj-$(CONFIG_MMIOTRACE) += mmiotrace.o
|
|
mmiotrace-y := kmmio.o pf_in.o mmio-mod.o
|
|
obj-$(CONFIG_MMIOTRACE_TEST) += testmmiotrace.o
|
|
|
|
obj-$(CONFIG_NUMA) += numa.o numa_$(BITS).o
|
|
obj-$(CONFIG_AMD_NUMA) += amdtopology.o
|
|
obj-$(CONFIG_ACPI_NUMA) += srat.o
|
|
obj-$(CONFIG_NUMA_EMU) += numa_emulation.o
|
|
|
|
obj-$(CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS) += pkeys.o
|
|
obj-$(CONFIG_RANDOMIZE_MEMORY) += kaslr.o
|
|
obj-$(CONFIG_PAGE_TABLE_ISOLATION) += pti.o
|
|
|
|
obj-$(CONFIG_AMD_MEM_ENCRYPT) += mem_encrypt.o
|
|
obj-$(CONFIG_AMD_MEM_ENCRYPT) += mem_encrypt_identity.o
|
|
obj-$(CONFIG_AMD_MEM_ENCRYPT) += mem_encrypt_boot.o
|