linux_dsm_epyc7002/arch/arm64
Andrey Ryabinin 39d114ddc6 arm64: add KASAN support
This patch adds arch specific code for kernel address sanitizer
(see Documentation/kasan.txt).

1/8 of kernel addresses reserved for shadow memory. There was no
big enough hole for this, so virtual addresses for shadow were
stolen from vmalloc area.

At early boot stage the whole shadow region populated with just
one physical page (kasan_zero_page). Later, this page reused
as readonly zero shadow for some memory that KASan currently
don't track (vmalloc).
After mapping the physical memory, pages for shadow memory are
allocated and mapped.

Functions like memset/memmove/memcpy do a lot of memory accesses.
If bad pointer passed to one of these function it is important
to catch this. Compiler's instrumentation cannot do this since
these functions are written in assembly.
KASan replaces memory functions with manually instrumented variants.
Original functions declared as weak symbols so strong definitions
in mm/kasan/kasan.c could replace them. Original functions have aliases
with '__' prefix in name, so we could call non-instrumented variant
if needed.
Some files built without kasan instrumentation (e.g. mm/slub.c).
Original mem* function replaced (via #define) with prefixed variants
to disable memory access checks for such files.

Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-10-12 17:46:36 +01:00
..
boot arm64: dts: juno: describe PMUs separately 2015-10-07 14:25:41 +01:00
configs arm64: defconfig: Enable samsung serial and mmc 2015-10-07 11:34:24 +01:00
crypto crypto: aead - Remove CRYPTO_ALG_AEAD_NEW flag 2015-08-17 16:53:53 +08:00
include arm64: add KASAN support 2015-10-12 17:46:36 +01:00
kernel arm64: add KASAN support 2015-10-12 17:46:36 +01:00
kvm Second set of KVM/ARM changes for 4.3-rc2 2015-09-17 16:51:59 +02:00
lib arm64: add KASAN support 2015-10-12 17:46:36 +01:00
mm arm64: add KASAN support 2015-10-12 17:46:36 +01:00
net arm64: bpf: fix endianness conversion bugs 2015-06-26 14:15:39 +01:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig arm64: add KASAN support 2015-10-12 17:46:36 +01:00
Kconfig.debug coresight: moving to new "hwtracing" directory 2015-04-03 16:17:04 +02:00
Kconfig.platforms arm64: Enable Marvell Berlin SoC family in Kconfig 2015-08-06 10:15:01 +02:00
Makefile arm64: add KASAN support 2015-10-12 17:46:36 +01:00