Re: [PATCH v2 1/6] mm/slab: Enable SLAB_FREELIST_HARDENED by default

From: Kees Cook

Date: Sat Oct 31 2026 - 00:13:46 EST


On Thu, Oct 29, 2026 at 02:07:22PM +0800, Chris Down wrote:
> SLAB_FREELIST_HARDENED obfuscates the free pointers stored in free
> objects, and catches naive double frees and frees to the wrong cache.
> Most distros already enable it, and with sheaves its cost is small,
> since the per-cpu fast paths don't touch freelists. Measurements also
> show this quite clearly [1][2].
>
> So let's just enable it by default. SLAB_BUCKETS defaults to
> SLAB_FREELIST_HARDENED, so it's now enabled by default too.
>
> Link: https://lore.kernel.org/all/auITixAJMfLtfa7i@xxxxxxxxxxxxxx/ [1]
> Link: https://lore.kernel.org/all/179312451613.474906.1475329637924619088@xxxxxxxxxx/ [2]
> Suggested-by: Vlastimil Babka <vbabka@xxxxxxxxxx>
> Signed-off-by: Chris Down <chris@xxxxxxxxxxxxxx>

Like I've always wanted it. :)

Reviewed-by: Kees Cook <kees@xxxxxxxxxx>

--
Kees Cook