Re: [PATCH] mm/slub: initialize the free pointer of the bootstrap kmem_cache_node

From: David Rientjes

Date: Fri Oct 16 2026 - 18:36:05 EST


On Sat, 10 Oct 2026, Karl Mehltretter wrote:

> With slub_debug=FZPU, validating kmem_cache_node reports
>
> BUG kmem_cache_node (Not tainted): Freepointer corrupt
> Object 0xffff888000140040 @offset=64 fp=0x5a5a5a5a5a5a5a5a
>
> and taints the kernel. Poisoning places the bootstrap object's free
> pointer outside the object, where check_object() checks it even while
> allocated.
>
> early_kmem_cache_node_alloc() previously took this object from a
> freelist with an initialized pointer. It now takes it from the slab
> iterator and builds the freelist only for the remaining objects,
> leaving its pointer filled with POISON_INUSE.
>
> Initialize the bootstrap object's free pointer to NULL.
>
> Fixes: dc795d4c0282 ("mm/slub: defer freelist construction until after bulk allocation from a new slab")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>

Tested-by: David Rientjes <rientjes@xxxxxxxxxx>