[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAeHK+ydCcdtn7u=nyBDxqffk_eTKA=sOTQzTnQuNZj81HxEJQ@mail.gmail.com>
Date: Mon, 23 Nov 2020 20:16:04 +0100
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Marco Elver <elver@...gle.com>,
Evgenii Stepanov <eugenis@...gle.com>,
Branislav Rankov <Branislav.Rankov@....com>,
Kevin Brodsky <kevin.brodsky@....com>,
kasan-dev <kasan-dev@...glegroups.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux-MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH mm v3 17/19] kasan: clean up metadata allocation and usage
On Mon, Nov 23, 2020 at 7:54 PM Andrey Konovalov <andreyknvl@...gle.com> wrote:
>
> > > @@ -168,6 +173,9 @@ void quarantine_put(struct kmem_cache *cache, void *object)
> > > struct qlist_head temp = QLIST_INIT;
> > > struct kasan_free_meta *meta = kasan_get_free_meta(cache, object);
> > >
> > > + if (!meta)
> > > + return;
> >
> > Humm... is this possible? If yes, we would be leaking the object here...
> > Perhaps BUG_ON with a comment instead.
>
> No, this isn't possible. Will turn this into a warning and add a comment.
Actually, looking as this some more, looks like with this change this
becomes possible. I think the best approach here is to not put such
objects into quarantine, and return proper value from
____kasan_slab_free() to avoid a leak. I'll fix this in the next
version.
Thanks!
Powered by blists - more mailing lists