arena: fix qcache double-free
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 30 Sep 2019 18:08:12 +0000 (14:08 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 8 Oct 2019 21:11:11 +0000 (17:11 -0400)
This was nasty.  The qcache would be freed twice, which meant that it
would get reused twice.  It resulted in the full_slab_list having weird
shit on it: it looked like a SLIST of magazines!

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/arena.c

index 5a006d9..cbf1711 100644 (file)
@@ -174,7 +174,7 @@ static void destroy_qcaches(struct arena *arena)
 
        for (int i = 0; i < nr_qcaches; i++) {
                kc = &arena->qcaches[i];
-               kmem_cache_destroy(kc);
+               __kmem_cache_destroy(kc);
        }
 
        base_free(arena, arena->qcaches,