slub: avoid potential NULL dereference or corruption
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 22 Nov 2011 15:02:02 +0000 (16:02 +0100)
committerPekka Enberg <penberg@kernel.org>
Thu, 24 Nov 2011 06:44:19 +0000 (08:44 +0200)
show_slab_objects() can trigger NULL dereferences or memory corruption.

Another cpu can change its c->page to NULL or c->node to NUMA_NO_NODE
while we use them.

Use ACCESS_ONCE(c->page) and ACCESS_ONCE(c->node) to make sure this
cannot happen.

Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slub.c

diff --cc mm/slub.c
Simple merge