[PATCH v3 1/6] mm/slab: Enable SLAB_FREELIST_HARDENED by default
From: Chris Down
Date: Fri Nov 13 2026 - 06:41:36 EST
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>
Reviewed-by: Kees Cook <kees@xxxxxxxxxx>
Signed-off-by: Chris Down <chris@xxxxxxxxxxxxxx>
---
mm/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/Kconfig b/mm/Kconfig
index afff1b25b543..f330c2c29fd2 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -208,6 +208,7 @@ config SLAB_FREELIST_RANDOM
config SLAB_FREELIST_HARDENED
bool "Harden slab freelist metadata"
depends on !SLUB_TINY
+ default y
help
Many kernel heap attacks try to target slab cache metadata and
other infrastructure. This options makes minor performance
--
2.56.1