linux/arch/arm64
Mark Rutland 0d97e6d802 arm64: kasan: clear stale stack poison
Functions which the compiler has instrumented for KASAN place poison on
the stack shadow upon entry and remove this poison prior to returning.

In the case of cpuidle, CPUs exit the kernel a number of levels deep in
C code.  Any instrumented functions on this critical path will leave
portions of the stack shadow poisoned.

If CPUs lose context and return to the kernel via a cold path, we
restore a prior context saved in __cpu_suspend_enter are forgotten, and
we never remove the poison they placed in the stack shadow area by
functions calls between this and the actual exit of the kernel.

Thus, (depending on stackframe layout) subsequent calls to instrumented
functions may hit this stale poison, resulting in (spurious) KASAN
splats to the console.

To avoid this, clear any stale poison from the idle thread for a CPU
prior to bringing a CPU online.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-03-09 15:43:42 -08:00
..
boot arm64: kbuild: make "make install" not depend on vmlinux 2016-02-19 10:33:35 +00:00
configs arm64: defconfig: updates for 4.5 2016-01-26 11:24:41 +00:00
crypto arm/arm64: crypto: assure that ECB modes don't require an IV 2016-02-15 15:48:29 +00:00
include arm64: vmemmap: use virtual projection of linear region 2016-02-26 17:59:04 +00:00
kernel arm64: kasan: clear stale stack poison 2016-03-09 15:43:42 -08:00
kvm arm/arm64: KVM: Fix ioctl error handling 2016-02-29 09:56:40 +00:00
lib arm64/efi: Make strnlen() available to the EFI namespace 2016-02-16 10:32:10 +00:00
mm arm64 fix: 2016-03-04 17:43:40 -08:00
net arm64: bpf: add extra pass to handle faulty codegen 2016-01-17 19:15:26 -05:00
xen xen/arm: introduce HYPERVISOR_platform_op on arm and arm64 2015-12-21 14:40:56 +00:00
Kconfig dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
Kconfig.debug arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug 2016-01-09 06:30:49 -08:00
Kconfig.platforms ARM: SoC support for Tegra platforms for v4.5 2016-01-22 17:30:52 -08:00
Makefile arm64: kbuild: make "make install" not depend on vmlinux 2016-02-19 10:33:35 +00:00