Blame SOURCES/recognize_multiple_page_slab_cache.patch

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