arm64: Add support for STACKLEAK gcc plugin
authorLaura Abbott <labbott@redhat.com>
Fri, 20 Jul 2018 21:41:54 +0000 (14:41 -0700)
committerWill Deacon <will.deacon@arm.com>
Thu, 26 Jul 2018 10:36:34 +0000 (11:36 +0100)
commit0b3e336601b82c6afa0e9cf21db9cb8793e25399
tree1ea6cdfc5d69f4ad5ad0e60ced11decc74ed0360
parent8a1ccfbc9e0256baafbbce85ccdb72ec89af2aab
arm64: Add support for STACKLEAK gcc plugin

This adds support for the STACKLEAK gcc plugin to arm64 by implementing
stackleak_check_alloca(), based heavily on the x86 version, and adding the
two helpers used by the stackleak common code: current_top_of_stack() and
on_thread_stack(). The stack erasure calls are made at syscall returns.
Additionally, this disables the plugin in hypervisor and EFI stub code,
which are out of scope for the protection.

Acked-by: Alexander Popov <alex.popov@linux.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/Kconfig
arch/arm64/include/asm/processor.h
arch/arm64/kernel/entry.S
arch/arm64/kernel/process.c
arch/arm64/kvm/hyp/Makefile
drivers/firmware/efi/libstub/Makefile