[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+ywW5S3fg=1=i4qXRNH_G3spXgV+f9XSAwtX1BUndyoKQ@mail.gmail.com>
Date: Fri, 18 Sep 2020 17:52:20 +0200
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Marco Elver <elver@...gle.com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Catalin Marinas <catalin.marinas@....com>,
kasan-dev <kasan-dev@...glegroups.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Evgenii Stepanov <eugenis@...gle.com>,
Elena Petrova <lenaptr@...gle.com>,
Branislav Rankov <Branislav.Rankov@....com>,
Kevin Brodsky <kevin.brodsky@....com>,
Will Deacon <will.deacon@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 33/37] kasan, arm64: implement HW_TAGS runtime
On Fri, Sep 18, 2020 at 5:19 PM Marco Elver <elver@...gle.com> wrote:
>
> On Tue, Sep 15, 2020 at 11:16PM +0200, Andrey Konovalov wrote:
>
> > diff --git a/include/linux/kasan.h b/include/linux/kasan.h
> > index 875bbcedd994..613c9d38eee5 100644
> > --- a/include/linux/kasan.h
> > +++ b/include/linux/kasan.h
> > @@ -184,7 +184,7 @@ static inline void kasan_record_aux_stack(void *ptr) {}
> >
> > #endif /* CONFIG_KASAN_GENERIC */
> >
> > -#ifdef CONFIG_KASAN_SW_TAGS
> > +#if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS)
> >
> > void kasan_init_tags(void);
> >
> > @@ -193,7 +193,7 @@ void *kasan_reset_tag(const void *addr);
> > bool kasan_report(unsigned long addr, size_t size,
> > bool is_write, unsigned long ip);
> >
> > -#else /* CONFIG_KASAN_SW_TAGS */
> > +#else /* CONFIG_KASAN_SW_TAGS || CONFIG_KASAN_HW_TAGS */
> >
> > static inline void kasan_init_tags(void) { }
> >
> > @@ -202,7 +202,7 @@ static inline void *kasan_reset_tag(const void *addr)
> > return (void *)addr;
> > }
> >
> > -#endif /* CONFIG_KASAN_SW_TAGS */
> > +#endif /* CONFIG_KASAN_SW_TAGS || CONFIG_KASAN_HW_TAGS*/
> >
> > #ifdef CONFIG_KASAN_VMALLOC
>
> It's not visible by looking at this diff, but there is some
> #ifdef-redundancy that I do not understand where it came from.
>
> This is what I have to fix it:
>
> diff --git a/include/linux/kasan.h b/include/linux/kasan.h
> index 613c9d38eee5..80a0e5b11f2b 100644
> --- a/include/linux/kasan.h
> +++ b/include/linux/kasan.h
> @@ -40,6 +40,12 @@ static inline void *kasan_mem_to_shadow(const void *addr)
> int kasan_add_zero_shadow(void *start, unsigned long size);
> void kasan_remove_zero_shadow(void *start, unsigned long size);
>
> +/* Enable reporting bugs after kasan_disable_current() */
> +extern void kasan_enable_current(void);
> +
> +/* Disable reporting bugs for current task */
> +extern void kasan_disable_current(void);
> +
> #else /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */
>
> static inline int kasan_add_zero_shadow(void *start, unsigned long size)
> @@ -50,18 +56,6 @@ static inline void kasan_remove_zero_shadow(void *start,
> unsigned long size)
> {}
>
> -#endif /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */
> -
> -#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
> -
> -/* Enable reporting bugs after kasan_disable_current() */
> -extern void kasan_enable_current(void);
> -
> -/* Disable reporting bugs for current task */
> -extern void kasan_disable_current(void);
> -
> -#else /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */
> -
> static inline void kasan_enable_current(void) {}
> static inline void kasan_disable_current(void) {}
Oh yeah, I'll fix this, thanks!
Powered by blists - more mailing lists