diff mbox series

[v1,-next] kasan: fix a missing header include of static_keys.h

Message ID 20220301154518.19456-1-joey.gouly@arm.com (mailing list archive)
State New, archived
Headers show
Series [v1,-next] kasan: fix a missing header include of static_keys.h | expand

Commit Message

Joey Gouly March 1, 2022, 3:45 p.m. UTC
The kasan-enabled.h header relies on static keys, so make sure
to include the header to avoid compilation errors (with JUMP_LABEL=n).

It fixes the following:
./include/linux/kasan-enabled.h:9:1: warning: data definition has no type or storage class
    9 | DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
      | ^~~~~~~~~~~~~~~~~~~~~~~~
error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int]

Fixes: f9b5e46f4097 ("kasan: split kasan_*enabled() functions into a separate header")
Cc: Peter Collingbourne <pcc@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 include/linux/kasan-enabled.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Catalin Marinas March 2, 2022, 11:16 a.m. UTC | #1
On Tue, Mar 01, 2022 at 03:45:18PM +0000, Joey Gouly wrote:
> The kasan-enabled.h header relies on static keys, so make sure
> to include the header to avoid compilation errors (with JUMP_LABEL=n).
> 
> It fixes the following:
> ./include/linux/kasan-enabled.h:9:1: warning: data definition has no type or storage class
>     9 | DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
>       | ^~~~~~~~~~~~~~~~~~~~~~~~
> error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int]
> 
> Fixes: f9b5e46f4097 ("kasan: split kasan_*enabled() functions into a separate header")
> Cc: Peter Collingbourne <pcc@google.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> ---
>  include/linux/kasan-enabled.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/kasan-enabled.h b/include/linux/kasan-enabled.h
> index 4b6615375022..6f612d69ea0c 100644
> --- a/include/linux/kasan-enabled.h
> +++ b/include/linux/kasan-enabled.h
> @@ -2,6 +2,8 @@
>  #ifndef _LINUX_KASAN_ENABLED_H
>  #define _LINUX_KASAN_ENABLED_H
>  
> +#include <linux/static_key.h>
> +
>  #ifdef CONFIG_KASAN_HW_TAGS
>  
>  DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);

The patch looks fine but you should cc the kasan maintainers (just run
the patch through scripts/get_maintainer.pl). Adding Andrey as he acked
the patch being fixed here.
Andrey Konovalov March 2, 2022, 3:25 p.m. UTC | #2
On Wed, Mar 2, 2022 at 12:16 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Tue, Mar 01, 2022 at 03:45:18PM +0000, Joey Gouly wrote:
> > The kasan-enabled.h header relies on static keys, so make sure
> > to include the header to avoid compilation errors (with JUMP_LABEL=n).
> >
> > It fixes the following:
> > ./include/linux/kasan-enabled.h:9:1: warning: data definition has no type or storage class
> >     9 | DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
> >       | ^~~~~~~~~~~~~~~~~~~~~~~~
> > error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int]
> >
> > Fixes: f9b5e46f4097 ("kasan: split kasan_*enabled() functions into a separate header")
> > Cc: Peter Collingbourne <pcc@google.com>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Will Deacon <will@kernel.org>
> > ---
> >  include/linux/kasan-enabled.h | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/include/linux/kasan-enabled.h b/include/linux/kasan-enabled.h
> > index 4b6615375022..6f612d69ea0c 100644
> > --- a/include/linux/kasan-enabled.h
> > +++ b/include/linux/kasan-enabled.h
> > @@ -2,6 +2,8 @@
> >  #ifndef _LINUX_KASAN_ENABLED_H
> >  #define _LINUX_KASAN_ENABLED_H
> >
> > +#include <linux/static_key.h>
> > +
> >  #ifdef CONFIG_KASAN_HW_TAGS
> >
> >  DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
>
> The patch looks fine but you should cc the kasan maintainers (just run
> the patch through scripts/get_maintainer.pl). Adding Andrey as he acked
> the patch being fixed here.

Thanks, Catalin.

Assuming linux/static_key.h is low-level enough to be included into
arch/arm64/include/asm/mte.h via linux/kasan-enabled.h,

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

for the fix.

Thank you!
Will Deacon March 7, 2022, 10:03 p.m. UTC | #3
On Tue, 1 Mar 2022 15:45:18 +0000, Joey Gouly wrote:
> The kasan-enabled.h header relies on static keys, so make sure
> to include the header to avoid compilation errors (with JUMP_LABEL=n).
> 
> It fixes the following:
> ./include/linux/kasan-enabled.h:9:1: warning: data definition has no type or storage class
>     9 | DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
>       | ^~~~~~~~~~~~~~~~~~~~~~~~
> error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int]
> 
> [...]

Applied to arm64 (for-next/mte), thanks!

[1/1] kasan: fix a missing header include of static_keys.h
      https://git.kernel.org/arm64/c/1a7b2121ebd3

Cheers,
Joey Gouly March 9, 2022, 9:49 a.m. UTC | #4
Hi Will,

On Mon, Mar 07, 2022 at 10:03:30PM +0000, Will Deacon wrote:
> On Tue, 1 Mar 2022 15:45:18 +0000, Joey Gouly wrote:
> > The kasan-enabled.h header relies on static keys, so make sure
> > to include the header to avoid compilation errors (with JUMP_LABEL=n).
> > 
> > It fixes the following:
> > ./include/linux/kasan-enabled.h:9:1: warning: data definition has no type or storage class
> >     9 | DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
> >       | ^~~~~~~~~~~~~~~~~~~~~~~~
> > error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int]
> > 
> > [...]
> 
> Applied to arm64 (for-next/mte), thanks!
> 
> [1/1] kasan: fix a missing header include of static_keys.h
>       https://git.kernel.org/arm64/c/1a7b2121ebd3

I accidentally deleted my sign off when adding the Fixes tag, spotted when merging into next:
  https://lore.kernel.org/lkml/20220309081719.54964469@canb.auug.org.au/

So here it is:
  Signed-off-by: Joey Gouly <joey.gouly@arm.com>

Let me know if I should resend the patch, or what I should do.

Thanks,
Joey
Will Deacon March 9, 2022, 12:14 p.m. UTC | #5
On Wed, Mar 09, 2022 at 09:49:07AM +0000, Joey Gouly wrote:
> Hi Will,
> 
> On Mon, Mar 07, 2022 at 10:03:30PM +0000, Will Deacon wrote:
> > On Tue, 1 Mar 2022 15:45:18 +0000, Joey Gouly wrote:
> > > The kasan-enabled.h header relies on static keys, so make sure
> > > to include the header to avoid compilation errors (with JUMP_LABEL=n).
> > > 
> > > It fixes the following:
> > > ./include/linux/kasan-enabled.h:9:1: warning: data definition has no type or storage class
> > >     9 | DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
> > >       | ^~~~~~~~~~~~~~~~~~~~~~~~
> > > error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int]
> > > 
> > > [...]
> > 
> > Applied to arm64 (for-next/mte), thanks!
> > 
> > [1/1] kasan: fix a missing header include of static_keys.h
> >       https://git.kernel.org/arm64/c/1a7b2121ebd3
> 
> I accidentally deleted my sign off when adding the Fixes tag, spotted when merging into next:
>   https://lore.kernel.org/lkml/20220309081719.54964469@canb.auug.org.au/
> 
> So here it is:
>   Signed-off-by: Joey Gouly <joey.gouly@arm.com>

Thanks, I'll add that to the patch.

Will
diff mbox series

Patch

diff --git a/include/linux/kasan-enabled.h b/include/linux/kasan-enabled.h
index 4b6615375022..6f612d69ea0c 100644
--- a/include/linux/kasan-enabled.h
+++ b/include/linux/kasan-enabled.h
@@ -2,6 +2,8 @@ 
 #ifndef _LINUX_KASAN_ENABLED_H
 #define _LINUX_KASAN_ENABLED_H
 
+#include <linux/static_key.h>
+
 #ifdef CONFIG_KASAN_HW_TAGS
 
 DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);