lkml.org 
[lkml]   [2021]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] kasan: fix build by including kernel.h
On Mon, Jul 5, 2021 at 9:27 AM Marco Elver <elver@google.com> wrote:
>
> The <linux/kasan.h> header relies on _RET_IP_ being defined, and had
> been receiving that definition via inclusion of bug.h which includes
> kernel.h. However, since f39650de687e that is no longer the case and get
> the following build error when building CONFIG_KASAN_HW_TAGS on arm64:
>
> In file included from arch/arm64/mm/kasan_init.c:10:
> ./include/linux/kasan.h: In function 'kasan_slab_free':
> ./include/linux/kasan.h:230:39: error: '_RET_IP_' undeclared (first use in this function)
> 230 | return __kasan_slab_free(s, object, _RET_IP_, init);
>
> Fix it by including kernel.h from kasan.h.
>
> Fixes: f39650de687e ("kernel.h: split out panic and oops helpers")
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Marco Elver <elver@google.com>
> ---
> include/linux/kasan.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/kasan.h b/include/linux/kasan.h
> index 5310e217bd74..dd874a1ee862 100644
> --- a/include/linux/kasan.h
> +++ b/include/linux/kasan.h
> @@ -3,6 +3,7 @@
> #define _LINUX_KASAN_H
>
> #include <linux/bug.h>
> +#include <linux/kernel.h>
> #include <linux/static_key.h>
> #include <linux/types.h>
>
> --
> 2.32.0.93.g670b81a890-goog
>

Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>

\
 
 \ /
  Last update: 2021-07-05 16:43    [W:0.069 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site