kernel_optimize_test/arch/arm64/kernel
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
..
vdso
.gitignore
acpi.c
alternative.c
arm64ksyms.c
armv8_deprecated.c
asm-offsets.c
cacheinfo.c
cpu_errata.c
cpu_ops.c
cpufeature.c
cpuidle.c
cpuinfo.c
debug-monitors.c
efi-entry.S
efi.c
entry-fpsimd.S
entry-ftrace.S
entry.S
entry32.S
fpsimd.c
ftrace.c
head.S
hw_breakpoint.c
hyp-stub.S
image.h
insn.c
io.c
irq.c
jump_label.c
kgdb.c
kuser32.S
Makefile
module.c
paravirt.c
pci.c
perf_callchain.c
perf_event.c
perf_regs.c
process.c
psci.c
ptrace.c
return_address.c
setup.c
signal.c
signal32.c
sleep.S
smccc-call.S
smp_spin_table.c
smp.c
stacktrace.c
suspend.c
sys_compat.c
sys.c
sys32.c
time.c
topology.c
trace-events-emulation.h
traps.c
vdso.c
vmlinux.lds.S