Re: [PATCH] kasan: prevent recursive instrumentation

From: Mark Rutland
Date: Thu Feb 28 2019 - 04:14:39 EST


On Mon, Feb 25, 2019 at 01:01:08PM +0100, Dmitry Vyukov wrote:
> On Mon, Feb 25, 2019 at 12:35 PM Mark Rutland <mark.rutland@xxxxxxx> wrote:
> >
> > On Sat, Feb 23, 2019 at 11:29:45AM +0100, Dmitry Vyukov wrote:
> > > On Fri, Feb 22, 2019 at 7:29 PM Mark Rutland <mark.rutland@xxxxxxx> wrote:
> > > >
> > > > When CONFIG_KASAN is selected, <linux/kasan-checks.h> defines the
> > > > prototypes for kasan_check_{read,write}(), rather than inline stubs.
> > >
> > > +kasan-dev@xxxxxxxxxxxxxxxx
> > >
> > > Doesn't this do the same as?
> > > https://groups.google.com/d/msg/kasan-dev/NwEdpGgUeac/oXUIRUC6CAAJ
> >
> > I had missed that patch -- thanks for the pointer!
> >
> > Either patch should both fix the issue with the EFI stub, but the
> > __kasan_check*() renaming in this patch also prevents unexpected
> > instrumentation within mm/kasan/common.c, if a call to kasan_check_*()
> > were inlined there.
> >
> > If you think that robustness is worthwhile, I can spin a v2 making that
> > a bit clearer, and fix the logic to look at __SANITIZE_ADDRESS__ rather
> > than adding the KASAN_NOSANITIZE definition.
> >
> > AFAICT Arnd's patch isn't queued anywhere just yet.
>
> I dunno. I don't have strong preference.
> Also not sure if Arnd's patch is not, say, in mm... problems of
> extremely long patch submission times... patches should take at most
> days to commit.

I see Arnd's patch is in linux-next today, so it looks like that's
solved.

I'll drop this patch unless we see any other problems.

Thanks,
Mark.