[PATCH v7 34/41] kasan, x86, s390: update undef CONFIG_KASAN

Vasily Gorbik gor at linux.ibm.com
Wed Nov 4 14:17:33 EST 2020


On Mon, Nov 02, 2020 at 05:04:14PM +0100, Andrey Konovalov wrote:
> 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.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl at google.com>
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino at arm.com>
> Reviewed-by: Marco Elver <elver at google.com>
> ---
> Change-Id: I2a622db0cb86a8feb60c30d8cb09190075be2a90
> ---
>  arch/s390/boot/string.c         | 1 +
>  arch/x86/boot/compressed/misc.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/arch/s390/boot/string.c b/arch/s390/boot/string.c
> index b11e8108773a..faccb33b462c 100644
> --- a/arch/s390/boot/string.c
> +++ b/arch/s390/boot/string.c
> @@ -3,6 +3,7 @@
>  #include <linux/kernel.h>
>  #include <linux/errno.h>
>  #undef CONFIG_KASAN
> +#undef CONFIG_KASAN_GENERIC
>  #include "../lib/string.c"

for s390 part
Acked-by: Vasily Gorbik <gor at linux.ibm.com>



More information about the linux-arm-kernel mailing list