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

kasan, x86, s390: update undef CONFIG_KASAN

With the intoduction of hardware tag-based KASAN some kernel checks of
this kind:

ifdef CONFIG_KASAN

will be updated to:

if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)

x86 and s390 use a trick to #undef CONFIG_KASAN for some of the code
that isn't linked with KASAN runtime and shouldn't have any KASAN
annotations.

Also #undef CONFIG_KASAN_GENERIC with CONFIG_KASAN.

Link: https://lkml.kernel.org/r/9d84bfaaf8fabe0fc89f913c9e420a30bd31a260.1606161801.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Marco Elver <elver@google.com>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Branislav Rankov <Branislav.Rankov@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrey Konovalov and committed by
Linus Torvalds
8a494023 6c6a04fe

+2
+1
arch/s390/boot/string.c
··· 3 3 #include <linux/kernel.h> 4 4 #include <linux/errno.h> 5 5 #undef CONFIG_KASAN 6 + #undef CONFIG_KASAN_GENERIC 6 7 #include "../lib/string.c" 7 8 8 9 int strncmp(const char *cs, const char *ct, size_t count)
+1
arch/x86/boot/compressed/misc.h
··· 12 12 #undef CONFIG_PARAVIRT_XXL 13 13 #undef CONFIG_PARAVIRT_SPINLOCKS 14 14 #undef CONFIG_KASAN 15 + #undef CONFIG_KASAN_GENERIC 15 16 16 17 /* cpu_feature_enabled() cannot be used this early */ 17 18 #define USE_EARLY_PGTABLE_L5