Re: [PATCH v2 3/5] kasan, arm64: don't instrument functions that enable kasan
From: Andrey Konovalov
Date: Tue Aug 04 2020 - 09:25:03 EST
On Tue, Aug 4, 2020 at 3:19 PM Catalin Marinas <catalin.marinas@xxxxxxx> wrote:
>
> On Tue, Aug 04, 2020 at 02:41:26PM +0200, Andrey Konovalov wrote:
> > This patch prepares Software Tag-Based KASAN for stack tagging support.
> >
> > With stack tagging enabled, KASAN tags stack variable in each function
> > in its prologue. In start_kernel() stack variables get tagged before KASAN
> > is enabled via setup_arch()->kasan_init(). As the result the tags for
> > start_kernel()'s stack variables end up in the temporary shadow memory.
> > Later when KASAN gets enabled, switched to normal shadow, and starts
> > checking tags, this leads to false-positive reports, as proper tags are
> > missing in normal shadow.
> >
> > Disable KASAN instrumentation for start_kernel(). Also disable it for
> > arm64's setup_arch() as a precaution (it doesn't have any stack variables
> > right now).
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
>
> I thought I acked this already. Either way:
>
> Acked-by: Catalin Marinas <catalin.marinas@xxxxxxx>
Sorry, I forgot to include that into v2. Thanks!