[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+yk6i0QUPZCw-582iX-HeifwNyMiVYsj5HLySuHvv5GVA@mail.gmail.com>
Date: Fri, 18 Sep 2020 16:56:13 +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 23/37] arm64: kasan: Add arch layer for memory tagging helpers
On Fri, Sep 18, 2020 at 3:00 PM Marco Elver <elver@...gle.com> wrote:
>
> On Tue, Sep 15, 2020 at 11:16PM +0200, 'Andrey Konovalov' via kasan-dev wrote:
> > This patch add a set of arch_*() memory tagging helpers currently only
> > defined for arm64 when hardware tag-based KASAN is enabled. These helpers
> > will be used by KASAN runtime to implement the hardware tag-based mode.
> >
> > The arch-level indirection level is introduced to simplify adding hardware
> > tag-based KASAN support for other architectures in the future by defining
> > the appropriate arch_*() macros.
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@...gle.com>
> > Co-developed-by: Vincenzo Frascino <vincenzo.frascino@....com>
> > Signed-off-by: Vincenzo Frascino <vincenzo.frascino@....com>
> > ---
> > Change-Id: I42b0795a28067872f8308e00c6f0195bca435c2a
> > ---
> > arch/arm64/include/asm/memory.h | 8 ++++++++
> > mm/kasan/kasan.h | 19 +++++++++++++++++++
> > 2 files changed, 27 insertions(+)
> >
> > diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
> > index e424fc3a68cb..268a3b6cebd2 100644
> > --- a/arch/arm64/include/asm/memory.h
> > +++ b/arch/arm64/include/asm/memory.h
> > @@ -231,6 +231,14 @@ static inline const void *__tag_set(const void *addr, u8 tag)
> > return (const void *)(__addr | __tag_shifted(tag));
> > }
> >
> > +#ifdef CONFIG_KASAN_HW_TAGS
> > +#define arch_init_tags(max_tag) mte_init_tags(max_tag)
> > +#define arch_get_random_tag() mte_get_random_tag()
> > +#define arch_get_mem_tag(addr) mte_get_mem_tag(addr)
> > +#define arch_set_mem_tag_range(addr, size, tag) \
> > + mte_set_mem_tag_range((addr), (size), (tag))
>
> Suggested edit below, assuming you're fine with checkpatch.pl's new
> 100col limit:
>
> -#define set_mem_tag_range(addr, size, tag) \
> - arch_set_mem_tag_range((addr), (size), (tag))
> +#define set_mem_tag_range(addr, size, tag) arch_set_mem_tag_range((addr), (size), (tag))
Will do in v3, thanks!
Powered by blists - more mailing lists