Re: [PATCH 1/2] mm/kasan: Fix KASAN poisoning in vrealloc()

From: Andrew Morton

Date: Sun Jan 18 2026 - 19:48:13 EST


On Sat, 17 Jan 2026 18:08:36 +0100 Andrey Konovalov <andreyknvl@xxxxxxxxx> wrote:

> On Sat, Jan 17, 2026 at 2:16 AM Andrey Konovalov <andreyknvl@xxxxxxxxx> wrote:
> >
> > On Fri, Jan 16, 2026 at 2:26 PM Andrey Ryabinin <ryabinin.a.a@xxxxxxxxx> wrote:
> > >
> > > So something like bellow I guess.
> >
> > Yeah, looks good.
> >
> > > I think this would actually have the opposite effect and make the code harder to follow.
> > > Introducing an extra wrapper adds another layer of indirection and more boilerplate, which
> > > makes the control flow less obvious and the code harder to navigate and grep.
> > >
> > > And what's the benefit here? I don't clearly see it.
> >
> > One functional benefit is when HW_TAGS mode enabled in .config but
> > disabled via command-line, we avoid a function call into KASAN
> > runtime.
>
> Ah, and I just realized than kasan_vrealloc should go into common.c -
> we also need it for HW_TAGS.

I think I'll send this cc:stable bugfix upstream as-is.

Can people please add these nice-to-have code-motion cleanup items to
their todo lists, to be attended to in the usual fashion?