diff --git a/mm/slub.c b/mm/slub.c index 59c33eec7728..18f5352f5e5c 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1690,6 +1690,7 @@ static void __free_slab(struct kmem_cache *s, struct page *page) if (current->reclaim_state) current->reclaim_state->reclaimed_slab += pages; memcg_uncharge_slab(page, order, s); + kasan_alloc_pages(page, order); __free_pages(page, order); } @@ -3903,6 +3904,7 @@ void kfree(const void *x) if (unlikely(!PageSlab(page))) { BUG_ON(!PageCompound(page)); kfree_hook(object); + kasan_alloc_pages(page, compound_order(page)); __free_pages(page, compound_order(page)); return; }