lkml.org 
[lkml]   [2020]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH mm v3 17/19] kasan: clean up metadata allocation and usage
On Tue, 17 Nov 2020 at 14:12, Dmitry Vyukov <dvyukov@google.com> wrote:

> > + */
> > *(u8 *)kasan_mem_to_shadow(object) = KASAN_KMALLOC_FREE;
> > +
> > ___cache_free(cache, object, _THIS_IP_);
> >
> > if (IS_ENABLED(CONFIG_SLAB))
> > @@ -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.

If this is possible in prod-mode KASAN, a WARN_ON() that returns would be safer.

\
 
 \ /
  Last update: 2020-11-17 15:10    [W:0.148 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site