slub: Fix kmem_cache_destroy() with SLAB_DESTROY_BY_RCU
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 3 Sep 2009 19:38:59 +0000 (22:38 +0300)
committerPekka Enberg <penberg@cs.helsinki.fi>
Thu, 3 Sep 2009 19:38:59 +0000 (22:38 +0300)
kmem_cache_destroy() should call rcu_barrier() *after* kmem_cache_close() and
*before* sysfs_slab_remove() or risk rcu_free_slab() being called after
kmem_cache is deleted (kfreed).

rmmod nf_conntrack can crash the machine because it has to kmem_cache_destroy()
a SLAB_DESTROY_BY_RCU enabled cache.

Cc: <stable@kernel.org>
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
mm/slub.c

diff --cc mm/slub.c
Simple merge