diff options
author | Christoph Lameter <cl@linux.com> | 2013-07-02 15:12:10 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2013-07-07 11:58:31 -0400 |
commit | 0f8f8094d28eb53368ac09186ea6b3a324cc7d44 (patch) | |
tree | 4f2d98ae905ce6405291880c034b18c8e59e2839 /mm/slab.c | |
parent | a6d78159f8a717263bea71bef738256dafe6260d (diff) |
slab: fix init_lock_keys
Some architectures (e.g. powerpc built with CONFIG_PPC_256K_PAGES=y
CONFIG_FORCE_MAX_ZONEORDER=11) get PAGE_SHIFT + MAX_ORDER > 26.
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: Christoph Lameter <cl@linux.com>
Reported-by: Tetsuo Handa <penguin-kernel@I-Love.SAKURA.ne.jp>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: <stable@vger.kernel.org> [3.10.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -565,7 +565,7 @@ static void init_node_lock_keys(int q) | |||
565 | if (slab_state < UP) | 565 | if (slab_state < UP) |
566 | return; | 566 | return; |
567 | 567 | ||
568 | for (i = 1; i < PAGE_SHIFT + MAX_ORDER; i++) { | 568 | for (i = 1; i <= KMALLOC_SHIFT_HIGH; i++) { |
569 | struct kmem_cache_node *n; | 569 | struct kmem_cache_node *n; |
570 | struct kmem_cache *cache = kmalloc_caches[i]; | 570 | struct kmem_cache *cache = kmalloc_caches[i]; |
571 | 571 | ||