android_kernel_xiaomi_sm8450/scripts/Makefile.kasan
Greg Kroah-Hartman 0907114be2 Merge 5.10.33 into android12-5.10
Changes in 5.10.33
	vhost-vdpa: protect concurrent access to vhost device iotlb
	gpio: omap: Save and restore sysconfig
	KEYS: trusted: Fix TPM reservation for seal/unseal
	vdpa/mlx5: Set err = -ENOMEM in case dma_map_sg_attrs fails
	pinctrl: lewisburg: Update number of pins in community
	block: return -EBUSY when there are open partitions in blkdev_reread_part
	pinctrl: core: Show pin numbers for the controllers with base = 0
	arm64: dts: allwinner: Revert SD card CD GPIO for Pine64-LTS
	bpf: Permits pointers on stack for helper calls
	bpf: Allow variable-offset stack access
	bpf: Refactor and streamline bounds check into helper
	bpf: Tighten speculative pointer arithmetic mask
	locking/qrwlock: Fix ordering in queued_write_lock_slowpath()
	perf/x86/intel/uncore: Remove uncore extra PCI dev HSWEP_PCI_PCU_3
	perf/x86/kvm: Fix Broadwell Xeon stepping in isolation_ucodes[]
	perf auxtrace: Fix potential NULL pointer dereference
	perf map: Fix error return code in maps__clone()
	HID: google: add don USB id
	HID: alps: fix error return code in alps_input_configured()
	HID cp2112: fix support for multiple gpiochips
	HID: wacom: Assign boolean values to a bool variable
	soc: qcom: geni: shield geni_icc_get() for ACPI boot
	dmaengine: xilinx: dpdma: Fix descriptor issuing on video group
	dmaengine: xilinx: dpdma: Fix race condition in done IRQ
	ARM: dts: Fix swapped mmc order for omap3
	net: geneve: check skb is large enough for IPv4/IPv6 header
	dmaengine: tegra20: Fix runtime PM imbalance on error
	s390/entry: save the caller of psw_idle
	arm64: kprobes: Restore local irqflag if kprobes is cancelled
	xen-netback: Check for hotplug-status existence before watching
	cavium/liquidio: Fix duplicate argument
	kasan: fix hwasan build for gcc
	csky: change a Kconfig symbol name to fix e1000 build error
	ia64: fix discontig.c section mismatches
	ia64: tools: remove duplicate definition of ia64_mf() on ia64
	x86/crash: Fix crash_setup_memmap_entries() out-of-bounds access
	net: hso: fix NULL-deref on disconnect regression
	USB: CDC-ACM: fix poison/unpoison imbalance
	Linux 5.10.33

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I638db3c919ad938eaaaac3d687175252edcd7990
2021-04-29 13:57:47 +02:00

58 lines
1.6 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0
CFLAGS_KASAN_NOSANITIZE := -fno-builtin
KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)
cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1)))
ifdef CONFIG_KASAN_STACK
stack_enable := 1
else
stack_enable := 0
endif
ifdef CONFIG_KASAN_GENERIC
ifdef CONFIG_KASAN_INLINE
call_threshold := 10000
else
call_threshold := 0
endif
CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address
# -fasan-shadow-offset fails without -fsanitize
CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \
-fasan-shadow-offset=$(KASAN_SHADOW_OFFSET), \
$(call cc-option, -fsanitize=kernel-address \
-mllvm -asan-mapping-offset=$(KASAN_SHADOW_OFFSET)))
ifeq ($(strip $(CFLAGS_KASAN_SHADOW)),)
CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
else
# Now add all the compiler specific options that are valid standalone
CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \
$(call cc-param,asan-globals=1) \
$(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \
$(call cc-param,asan-stack=$(stack_enable)) \
$(call cc-param,asan-instrument-allocas=1)
endif
endif # CONFIG_KASAN_GENERIC
ifdef CONFIG_KASAN_SW_TAGS
ifdef CONFIG_KASAN_INLINE
instrumentation_flags := $(call cc-param,hwasan-mapping-offset=$(KASAN_SHADOW_OFFSET))
else
instrumentation_flags := $(call cc-param,hwasan-instrument-with-calls=1)
endif
CFLAGS_KASAN := -fsanitize=kernel-hwaddress \
$(call cc-param,hwasan-instrument-stack=$(stack_enable)) \
$(call cc-param,hwasan-use-short-granules=0) \
$(instrumentation_flags)
endif # CONFIG_KASAN_SW_TAGS
export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE