Commit 0f8f8094 authored by Christoph Lameter's avatar Christoph Lameter Committed by Pekka Enberg
Browse files

slab: fix init_lock_keys

Some architectures (e.g. powerpc built with CONFIG_PPC_256K_PAGES=y

In 3.10 kernels, CONFIG_LOCKDEP=y with PAGE_SHIFT + MAX_ORDER > 26 makes
init_lock_keys() dereference beyond kmalloc_caches[26].
This leads to an unbootable system (kernel panic at initializing SLAB)
if one of kmalloc_caches[26...PAGE_SHIFT+MAX_ORDER-1] is not NULL.

Fix this by making sure that init_lock_keys() does not dereference beyond
kmalloc_caches[26] arrays.

Signed-off-by: default avatarChristoph Lameter <>
Reported-by: default avatarTetsuo Handa <>
Cc: Pekka Enberg <>
Cc: <>	[3.10.x]
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarPekka Enberg <>
parent a6d78159
......@@ -565,7 +565,7 @@ static void init_node_lock_keys(int q)
if (slab_state < UP)
for (i = 1; i < PAGE_SHIFT + MAX_ORDER; i++) {
for (i = 1; i <= KMALLOC_SHIFT_HIGH; i++) {
struct kmem_cache_node *n;
struct kmem_cache *cache = kmalloc_caches[i];
Supports Markdown
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