Re: [PATCH] mm: kmemleak: slob: respect SLAB_NOLEAKTRACE flag

From: Muchun Song
Date: Tue Nov 16 2021 - 00:37:46 EST

On Mon, Nov 15, 2021 at 10:09 AM Rustam Kovhaev <rkovhaev@xxxxxxxxx> wrote:
> When kmemleak is enabled for SLOB, system does not boot and does not
> print anything to the console. At the very early stage in the boot
> process we hit infinite recursion from kmemleak_init() and eventually
> kernel crashes.
> kmemleak_init() specifies SLAB_NOLEAKTRACE for KMEM_CACHE(), but
> kmem_cache_create_usercopy() removes it because CACHE_CREATE_MASK is not
> valid for SLOB.
> Let's fix CACHE_CREATE_MASK and make kmemleak work with SLOB
> Fixes: d8843922fba4 ("slab: Ignore internal flags in cache creation")
> Signed-off-by: Rustam Kovhaev <rkovhaev@xxxxxxxxx>

Reviewed-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>