Skip to content
Commit fcf88917 authored by Qian Cai's avatar Qian Cai Committed by Linus Torvalds
Browse files

slab: fix a crash by reading /proc/slab_allocators

The commit 510ded33 ("slab: implement slab_root_caches list")
changes the name of the list node within "struct kmem_cache" from "list"
to "root_caches_node", but leaks_show() still use the "list" which
causes a crash when reading /proc/slab_allocators.

You need to have CONFIG_SLAB=y and CONFIG_MEMCG=y to see the problem,
because without MEMCG all slab caches are root caches, and the "list"
node happens to be the right one.

Fixes: 510ded33

 ("slab: implement slab_root_caches list")
Signed-off-by: default avatarQian Cai <cai@lca.pw>
Reviewed-by: default avatarTobin C. Harding <tobin@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 15ade5d2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment