[PATCH 0/8] mm/slab: Support selecting slab hardening features at boot
From: Chris Down
Date: Tue Oct 27 2026 - 03:37:20 EST
Slab hardening settings are currently all build time choices. This means
that, unfortunately, hosts with different requirements end up needing
separate kernel images. Let's allow those hosts to use one image and
select each policy at boot instead.
This series adds four new boot parameters that default to their values
from CONFIG_*:
slab_freelist_hardened=
slab_freelist_random=
slab_buckets=
kmalloc_partition=
These mostly act at cache initialisation time. For free list hardening we
use a static key settled before the first free pointer is written.
Chris Down (8):
mm/slub: Support disabling freelist hardening at boot
slub_kunit: Add a test for slab_freelist_hardened=
mm/slub: Support disabling freelist randomisation at boot
slub_kunit: Add a test for slab_freelist_random=
mm/slab: Support disabling SLAB_BUCKETS at boot
slub_kunit: Add a test for the slab_buckets boot parameter
mm/slab: Support disabling KMALLOC_PARTITION_CACHES at boot
slub_kunit: Add a test for the kmalloc_partition boot parameter
.../admin-guide/kernel-parameters.txt | 29 +++
lib/tests/slub_kunit.c | 186 ++++++++++++++++++
mm/Kconfig | 15 ++
mm/slab.h | 24 +++
mm/slab_common.c | 48 ++++-
mm/slub.c | 68 ++++++-
scripts/gdb/linux/slab.py | 8 +-
7 files changed, 361 insertions(+), 17 deletions(-)
base-commit: d15d7703166daf7bd62c844a3cb1b3a6279adb4c
--
2.54.0