Re: [PATCH v9 17/44] kasan, arm64: move initialization message

From: Alexander Potapenko
Date: Thu Nov 12 2020 - 10:09:41 EST


On Wed, Nov 11, 2020 at 7:50 PM Andrey Konovalov <andreyknvl@xxxxxxxxxx> wrote:
>
> On Wed, Nov 11, 2020 at 4:04 PM Alexander Potapenko <glider@xxxxxxxxxx> wrote:
> >
> > On Tue, Nov 10, 2020 at 11:11 PM Andrey Konovalov <andreyknvl@xxxxxxxxxx> wrote:
> > >
> > > Software tag-based KASAN mode is fully initialized with kasan_init_tags(),
> > > while the generic mode only requires kasan_init(). Move the
> > > initialization message for tag-based mode into kasan_init_tags().
> > >
> > > Also fix pr_fmt() usage for KASAN code: generic.c doesn't need it as it
> > > doesn't use any printing functions; tag-based mode should use "kasan:"
> > > instead of KBUILD_MODNAME (which stands for file name).
> > >
> > > Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
> > > Reviewed-by: Catalin Marinas <catalin.marinas@xxxxxxx>

Reviewed-by: Alexander Potapenko <glider@xxxxxxxxxx>

> > Cannot we have a single kasan_init() function that will call
> > tool-specific initialization functions and print the message at the
> > end?
>
> Unfortunately no. For different modes we need different functions that
> are called in different places in the kernel. E.g. for generic KASAN
> we only need kasan_init() to setup shadow pages; for SW tags we also
> need kasan_init_sw_tags() which initializes per-cpu state and
> finilizes initialization process.

Ok, got it.

--
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg