path: root/mm/slub.c
diff options
authorMarco Elver <>2022-04-14 19:13:40 -0700
committerLinus Torvalds <>2022-04-15 14:49:55 -0700
commit2dfe63e61cc31ee59ce951672b0850b5229cd5b0 (patch)
tree9194074ed5008747db7b6a0aed068751d8b50b20 /mm/slub.c
parentb1add418d457bc30cdd6a89c2bba092cd8941fcf (diff)
mm, kfence: support kmem_dump_obj() for KFENCE objects
Calling kmem_obj_info() via kmem_dump_obj() on KFENCE objects has been producing garbage data due to the object not actually being maintained by SLAB or SLUB. Fix this by implementing __kfence_obj_info() that copies relevant information to struct kmem_obj_info when the object was allocated by KFENCE; this is called by a common kmem_obj_info(), which also calls the slab/slub/slob specific variant now called __kmem_obj_info(). For completeness, kmem_dump_obj() now displays if the object was allocated by KFENCE. Link: Link: Fixes: b89fb5ef0ce6 ("mm, kfence: insert KFENCE hooks for SLUB") Fixes: d3fb45f370d9 ("mm, kfence: insert KFENCE hooks for SLAB") Signed-off-by: Marco Elver <> Reviewed-by: Hyeonggon Yoo <> Reported-by: kernel test robot <> Acked-by: Vlastimil Babka <> [slab] Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/slub.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 74d92aa4a3a2..ed5c2c03a47a 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4312,7 +4312,7 @@ int __kmem_cache_shutdown(struct kmem_cache *s)
-void kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *slab)
+void __kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *slab)
void *base;
int __maybe_unused i;