commit 2e3b89ed93dfd266d4061445bb04b20574461539
Author: Dave Anderson <anderson@redhat.com>
Date: Fri Jul 17 10:41:32 2015 -0400
Fix for the "kmem -s <address>", "bt -F[F]", and "rd -S[S]"
options in kernels configured with CONFIG_SLUB. Without the patch,
if a referenced slab object address comes from a slab cache that
utilizes a multiple-page slab, and the object is located within
a tail page of that slab cache, it will not be recognized as a slab
object. The "bt -F[F]" and "rd -S[S]" options will just show the
object address, and the "kmem -s <address>" object will indicate
"kmem: address is not allocated in slab subsystem: <address>".
This bug is a regression that was introduced in crash-7.1.0 by commit
8b2cb365d7fb139e77cedd80d4061332099ed382, which addressed a bug where
stale slab object addresses were incorrectly being recognized as
valid slab objects.
(anderson@redhat.com)
diff --git a/memory.c b/memory.c
index fa2970c..a7988fd 100644
--- a/memory.c
+++ b/memory.c
@@ -9103,8 +9103,16 @@ vaddr_to_kmem_cache(ulong vaddr, char *buf, int verbose)
readmem(page+OFFSET(page_flags), KVADDR,
&page_flags, sizeof(ulong), "page.flags",
FAULT_ON_ERROR);
- if (!(page_flags & (1 << vt->PG_slab)))
- return NULL;
+ if (!(page_flags & (1 << vt->PG_slab))) {
+ if (vt->flags & KMALLOC_SLUB) {
+ readmem(compound_head(page)+OFFSET(page_flags), KVADDR,
+ &page_flags, sizeof(ulong), "page.flags",
+ FAULT_ON_ERROR);
+ if (!(page_flags & (1 << vt->PG_slab)))
+ return NULL;
+ } else
+ return NULL;
+ }
}
if ((vt->flags & KMALLOC_SLUB) ||