diff options
author | Tero Roponen <tero.roponen@gmail.com> | 2010-12-01 13:04:20 -0500 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2010-12-04 02:40:16 -0500 |
commit | 8165984acf825917437debae519209073c32a5a7 (patch) | |
tree | b4322432ad62529a7eee6b9621473a9e1b58be3c | |
parent | 85beb5869a4f6abb52a7cf8e01de6fa57e9ee47d (diff) |
slub: Fix a crash during slabinfo -v
Commit f7cb1933621bce66a77f690776a16fe3ebbc4d58 ("SLUB: Pass active
and inactive redzone flags instead of boolean to debug functions")
missed two instances of check_object(). This caused a lot of warnings
during 'slabinfo -v' finally leading to a crash:
BUG ext4_xattr: Freepointer corrupt
...
BUG buffer_head: Freepointer corrupt
...
BUG ext4_alloc_context: Freepointer corrupt
...
...
BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [<ffffffff810a291f>] file_sb_list_del+0x1c/0x35
PGD 79d78067 PUD 79e67067 PMD 0
Oops: 0002 [#1] SMP
last sysfs file: /sys/kernel/slab/:t-0000192/validate
This patch fixes the problem by converting the two missed instances.
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tero Roponen <tero.roponen@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r-- | mm/slub.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3417,13 +3417,13 @@ static int validate_slab(struct kmem_cache *s, struct page *page, | |||
3417 | 3417 | ||
3418 | for_each_free_object(p, s, page->freelist) { | 3418 | for_each_free_object(p, s, page->freelist) { |
3419 | set_bit(slab_index(p, s, addr), map); | 3419 | set_bit(slab_index(p, s, addr), map); |
3420 | if (!check_object(s, page, p, 0)) | 3420 | if (!check_object(s, page, p, SLUB_RED_INACTIVE)) |
3421 | return 0; | 3421 | return 0; |
3422 | } | 3422 | } |
3423 | 3423 | ||
3424 | for_each_object(p, s, addr, page->objects) | 3424 | for_each_object(p, s, addr, page->objects) |
3425 | if (!test_bit(slab_index(p, s, addr), map)) | 3425 | if (!test_bit(slab_index(p, s, addr), map)) |
3426 | if (!check_object(s, page, p, 1)) | 3426 | if (!check_object(s, page, p, SLUB_RED_ACTIVE)) |
3427 | return 0; | 3427 | return 0; |
3428 | return 1; | 3428 | return 1; |
3429 | } | 3429 | } |