Re: [PATCH] kasan: fix bad call to unpoison_slab_object

From: Andrey Konovalov
Date: Fri Jun 14 2024 - 10:35:56 EST


On Fri, Jun 14, 2024 at 4:29 PM Marco Elver <elver@xxxxxxxxxx> wrote:
>
> On Fri, 14 Jun 2024 at 16:16, <andrey.konovalov@xxxxxxxxx> wrote:
> >
> > From: Andrey Konovalov <andreyknvl@xxxxxxxxx>
> >
> > Commit 29d7355a9d05 ("kasan: save alloc stack traces for mempool") messed
> > up one of the calls to unpoison_slab_object: the last two arguments are
> > supposed to be GFP flags and whether to init the object memory.
> >
> > Fix the call.
> >
> > Without this fix, unpoison_slab_object provides the object's size as
> > GFP flags to unpoison_slab_object, which can cause LOCKDEP reports
> > (and probably other issues).
> >
> > Fixes: 29d7355a9d05 ("kasan: save alloc stack traces for mempool")
> > Reported-by: Brad Spengler <spender@xxxxxxxxxxxxxx>
> > Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxx>
>
> Oof.
>
> Acked-by: Marco Elver <elver@xxxxxxxxxx>
>
> mm needs explicit Cc: stable, right? If so, we better add Cc: stable as well.

Makes sense, sent v2 with CC stable and a commit message fix.

Thanks!