slub: Potential stack overflow
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 24 Mar 2010 21:25:47 +0000 (22:25 +0100)
committerPekka Enberg <penberg@cs.helsinki.fi>
Sat, 22 May 2010 07:57:30 +0000 (10:57 +0300)
commitbbd7d57bfe852d9788bae5fb171c7edb4021d8ac
tree9b16ed244e0bd0b71a1d3d6e662be310f1e8f9c2
parente40152ee1e1c7a63f4777791863215e3faa37a86
slub: Potential stack overflow

I discovered that we can overflow stack if CONFIG_SLUB_DEBUG=y and use slabs
with many objects, since list_slab_objects() and process_slab() use
DECLARE_BITMAP(map, page->objects).

With 65535 bits, we use 8192 bytes of stack ...

Switch these allocations to dynamic allocations.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
mm/slub.c