Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 9017/2: Enable KASan for ARM

This patch enables the kernel address sanitizer for ARM. XIP_KERNEL
has not been tested and is therefore not allowed for now.

Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: kasan-dev@googlegroups.com
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Ard Biesheuvel <ardb@kernel.org> # QEMU/KVM/mach-virt/LPAE/8G
Tested-by: Florian Fainelli <f.fainelli@gmail.com> # Brahma SoCs
Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> # i.MX6Q
Signed-off-by: Abbott Liu <liuwenliang@huawei.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

authored by

Linus Walleij and committed by
Russell King
42101571 5615f69b

+4 -3
+2 -2
Documentation/dev-tools/kasan.rst
··· 18 18 19 19 Tag-based KASAN is only supported in Clang. 20 20 21 - Currently generic KASAN is supported for the x86_64, arm64, xtensa, s390 and 22 - riscv architectures, and tag-based KASAN is supported only for arm64. 21 + Currently generic KASAN is supported for the x86_64, arm, arm64, xtensa, s390 22 + and riscv architectures, and tag-based KASAN is supported only for arm64. 23 23 24 24 Usage 25 25 -----
+1 -1
Documentation/features/debug/KASAN/arch-support.txt
··· 8 8 ----------------------- 9 9 | alpha: | TODO | 10 10 | arc: | TODO | 11 - | arm: | TODO | 11 + | arm: | ok | 12 12 | arm64: | ok | 13 13 | c6x: | TODO | 14 14 | csky: | TODO |
+1
arch/arm/Kconfig
··· 67 67 select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6 68 68 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU 69 69 select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU 70 + select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL 70 71 select HAVE_ARCH_MMAP_RND_BITS if MMU 71 72 select HAVE_ARCH_SECCOMP 72 73 select HAVE_ARCH_SECCOMP_FILTER if AEABI && !OABI_COMPAT