slub: Fix kmem_cache_destroy() with SLAB_DESTROY_BY_RCU
Eric Dumazet authored
commit d76b1590

 upstream.

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.
Reported-by: default avatarZdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
e8f23f08
Name Last commit Last update
..
Kconfig security: use mmap_min_addr indepedently of security models
Kconfig.debug generic debug pagealloc: build fix
Makefile generic debug pagealloc
allocpercpu.c percpu: __percpu_depopulate_mask can take a const mask
backing-dev.c block: change the request allocation/congestion logic to be sync/async based
bootmem.c bootmem, x86: further fixes for arch-specific bootmem wrapping
bounce.c bounce: don't rely on a zeroed bio_vec list
debug-pagealloc.c generic debug pagealloc
dmapool.c dmapool: enable debugging for CONFIG_SLUB_DEBUG_ON too
fadvise.c [CVE-2009-0029] System call wrapper special cases
failslab.c kmemtrace, mm: fix slab.h dependency problem in mm/failslab.c
filemap.c mm: mark page accessed before we write_end()
filemap_xip.c mm: do_xip_mapping_read: fix length calculation
fremap.c Do not account for the address space used by hugetlbfs using VM_ACCOUNT
highmem.c mm: introduce debug_kmap_atomic
hugetlb.c hugetlbfs: fix i_blocks accounting
internal.h vmscan: do not unconditionally treat zones that fail zone_reclaim() as full
maccess.c kgdb: fix optional arch functions and probe_kernel_*
madvise.c Revert "Ignore madvise(MADV_WILLNEED) for hugetlbfs-backed regions"
memcontrol.c memcg: fix build warning and avoid checking for mem != null again and again
memory.c mm: close page_mkwrite races
memory_hotplug.c mm: remove GFP_HIGHUSER_PAGECACHE
mempolicy.c [CVE-2009-0029] System call wrappers part 28
mempool.c spelling fixes: mm/
migrate.c FS-Cache: Recruit a page flags for cache management
mincore.c
mlock.c
mm_init.c
mmap.c
mmu_notifier.c
mmzone.c
mprotect.c
mremap.c
msync.c
nommu.c
oom_kill.c
page-writeback.c
page_alloc.c
page_cgroup.c
page_io.c
page_isolation.c
pagewalk.c
pdflush.c
percpu.c
prio_tree.c
quicklist.c
readahead.c
rmap.c
shmem.c
shmem_acl.c
slab.c
slob.c
slub.c
sparse-vmemmap.c
sparse.c
swap.c
swap_state.c
swapfile.c
thrash.c
truncate.c
util.c
vmalloc.c
vmscan.c
vmstat.c