Re: [PATCH 1/2] mm/kasan: Fix KASAN poisoning in vrealloc()
From: Andrey Konovalov
Date: Sat Jan 17 2026 - 12:08:48 EST
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.
>
> From the readability perspective, what we had before the recent
> clean-up was an assortment of kasan_enabled/kasan_arch_ready checks in
> lower-level KASAN functions, which made it hard to figure out what
> actually happens when KASAN is not enabled. And these high-level
> checks make it more clear. At least in my opinion.