path: root/mm/slub.c
diff options
authorMatthew Wilcox (Oracle) <>2021-10-04 14:46:46 +0100
committerVlastimil Babka <>2022-01-06 12:26:14 +0100
commit6e48a966dfd18987fec9385566a67d36e2b5fc11 (patch)
tree86563a5541c93ba5be6ba7963d2e58ada19ebd82 /mm/slub.c
parent50757018b4c9b02dbf7fcc0514e0fc45b8689c62 (diff)
mm/kasan: Convert to struct folio and struct slab
KASAN accesses some slab related struct page fields so we need to convert it to struct slab. Some places are a bit simplified thanks to kasan_addr_to_slab() encapsulating the PageSlab flag check through virt_to_slab(). When resolving object address to either a real slab or a large kmalloc, use struct folio as the intermediate type for testing the slab flag to avoid unnecessary implicit compound_head(). [ use struct folio, adjust to differences in previous patches ] Signed-off-by: Matthew Wilcox (Oracle) <> Signed-off-by: Vlastimil Babka <> Reviewed-by: Andrey Konovalov <> Reviewed-by: Roman Gushchin <> Tested-by: Hyeongogn Yoo <> Cc: Andrey Ryabinin <> Cc: Alexander Potapenko <> Cc: Andrey Konovalov <> Cc: Dmitry Vyukov <> Cc: <>
Diffstat (limited to 'mm/slub.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index ddf21c7a381a..d08ba1025aae 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1961,7 +1961,7 @@ static struct slab *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
slab->slab_cache = s;
- kasan_poison_slab(slab_page(slab));
+ kasan_poison_slab(slab);
start = slab_address(slab);