| From: |
| Chris Down <chris-AT-chrisdown.name> |
| To: |
| Vlastimil Babka <vbabka-AT-kernel.org>, Harry Yoo <harry-AT-kernel.org>, Andrew Morton <akpm-AT-linux-foundation.org> |
| Subject: |
| [PATCH 0/8] mm/slab: Support selecting slab hardening features at boot |
| Date: |
| Tue, 27 Oct 2026 15:35:16 +0800 |
| Message-ID: |
| <cover.1793086056.git.chris@chrisdown.name> |
| Cc: |
| Hao Li <hao.li-AT-linux.dev>, Christoph Lameter <cl-AT-gentwo.org>, David Rientjes <rientjes-AT-google.com>, Roman Gushchin <roman.gushchin-AT-linux.dev>, Kees Cook <kees-AT-kernel.org>, Marco Elver <elver-AT-google.com>, GONG Ruiqi <gongruiqi-AT-huaweicloud.com>, Jan Kiszka <jan.kiszka-AT-siemens.com>, Kieran Bingham <kbingham-AT-kernel.org>, Jonathan Corbet <corbet-AT-lwn.net>, linux-mm-AT-kvack.org, linux-hardening-AT-vger.kernel.org, linux-doc-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, kernel-team-AT-meta.com |
| Archive-link: |
| Article |
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