From: Linus Walleij
mainline inclusion
from mainline-5.11-rc1
commit 421015713b306e47af95d4d61cdfbd96d462e4cb
category: feature
feature: ARM KASAN support
issue: #I3ZXZF
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
-------------------------------------------------
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
Cc: Alexander Potapenko
Cc: Dmitry Vyukov
Cc: kasan-dev@googlegroups.com
Acked-by: Dmitry Vyukov
Reviewed-by: Ard Biesheuvel
Tested-by: Ard Biesheuvel # QEMU/KVM/mach-virt/LPAE/8G
Tested-by: Florian Fainelli # Brahma SoCs
Tested-by: Ahmad Fatoum # i.MX6Q
Signed-off-by: Abbott Liu
Signed-off-by: Florian Fainelli
Signed-off-by: Linus Walleij
Signed-off-by: Russell King
(cherry picked from commit 421015713b306e47af95d4d61cdfbd96d462e4cb)
Signed-off-by: Kefeng Wang
Reviewed-by: Jing Xiangfeng
Signed-off-by: Chen Jun
Signed-off-by: Yu Changchun
---
Documentation/dev-tools/kasan.rst | 4 ++--
Documentation/features/debug/KASAN/arch-support.txt | 2 +-
arch/arm/Kconfig | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst
index 2b68addaadcd..b3e489064a18 100644
--- a/Documentation/dev-tools/kasan.rst
+++ b/Documentation/dev-tools/kasan.rst
@@ -18,8 +18,8 @@ out-of-bounds accesses for global variables is only supported since Clang 11.
Tag-based KASAN is only supported in Clang.
-Currently generic KASAN is supported for the x86_64, arm64, xtensa, s390 and
-riscv architectures, and tag-based KASAN is supported only for arm64.
+Currently generic KASAN is supported for the x86_64, arm, arm64, xtensa, s390
+and riscv architectures, and tag-based KASAN is supported only for arm64.
Usage
-----
diff --git a/Documentation/features/debug/KASAN/arch-support.txt b/Documentation/features/debug/KASAN/arch-support.txt
index c3fe9b266e7b..b2288dc14b72 100644
--- a/Documentation/features/debug/KASAN/arch-support.txt
+++ b/Documentation/features/debug/KASAN/arch-support.txt
@@ -8,7 +8,7 @@
-----------------------
| alpha: | TODO |
| arc: | TODO |
- | arm: | TODO |
+ | arm: | ok |
| arm64: | ok |
| c6x: | TODO |
| csky: | TODO |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index fc530fad13b2..5516dd83409e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -68,6 +68,7 @@ config ARM
select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
+ select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
select HAVE_ARCH_MMAP_RND_BITS if MMU
select HAVE_ARCH_SECCOMP
select HAVE_ARCH_SECCOMP_FILTER if AEABI && !OABI_COMPAT
--
2.22.0