[PATCH] mm: slub: Print the broken data before restoring slub.
From: Hyesoo Yu
Date: Mon Jan 20 2025 - 03:31:59 EST
Previously, the restore occured after printing the object in slub.
After commit 47d911b ("slab: make check_object() more consistent"),
the bytes are printed after the restore. This information about the bytes
before the restore is highly valuable for debugging purpose.
For instance, in a event of cache issue, it displays byte patterns
by breaking them down into 64-bytes units. Without this information,
we can only speculate on how it was broken. Hence the corrupted regions
are printed prior to the restoration process.
Signed-off-by: Hyesoo Yu <hyesoo.yu@xxxxxxxxxxx>
Change-Id: Iac1df0526808edc2318f9988c757cdc3e40ae4b2
---
mm/slub.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/slub.c b/mm/slub.c
index c2151c9fee22..48cefc969480 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1207,6 +1207,7 @@ check_bytes_and_report(struct kmem_cache *s, struct slab *slab,
fault[0], value);
skip_bug_print:
+ print_section(KERN_ERR, "Corrupt ", fault, end - fault);
restore_bytes(s, what, value, fault, end);
return 0;
}
--
2.48.0