v1
2026-10-29
slab 加固特性启动可选 · v1
将 SLUB 加固和分区策略改为启动参数:新增 slab_freelist_hardened/random、slab_buckets、kmalloc_partition,默认沿用 CONFIG。
原始补丁链接
子 Patch(8)
1/8
mm/slub: Support disabling freelist hardening at boot
Add the slab_freelist_hardened= early parameter, enabled by default on kernels built with CONFIG_SLAB_FREELIST_HARDENED=y. Signed-off-by: Chris Down chris@chrisdown.name — …/admin-guide/kernel
2/8
slub_kunit: Add a test for slab_freelist_hardened=
Signed-off-by: Chris Down chris@chrisdown.name — lib/tests/slub_kunit.c | 52 ++++++++++++++++++++++++++++++++++++++++++ mm/slub.c | 2 ++ 2 files changed , 54 insertions(+) diff –
3/8
mm/slub: Support disabling freelist randomisation at boot
Add a slab_freelist_random= early parameter, enabled by default on kernels built with CONFIG_SLAB_FREELIST_RANDOM=y. Signed-off-by: Chris Down chris@chrisdown.name — Documentation/admin-guide/ke
4/8
slub_kunit: Add a test for slab_freelist_random=
Signed-off-by: Chris Down chris@chrisdown.name — lib/tests/slub_kunit.c | 51 ++++++++++++++++++++++++++++++++++++++++++ mm/slab.h | 3 +++ mm/slub.c | 3 ++- 3 files
5/8
mm/slab: Support disabling SLAB_BUCKETS at boot
Add a slab_buckets= early parameter, enabled by default on kernels built with CONFIG_SLAB_BUCKETS=y. Signed-off-by: Chris Down chris@chrisdown.name — …/admin-guide/kernel-parameters.txt
6/8
slub_kunit: Add a test for the slab_buckets boot parameter
Signed-off-by: Chris Down chris@chrisdown.name — lib/tests/slub_kunit.c | 37 +++++++++++++++++++++++++++++++++++++ mm/slab.h | 4 ++++ mm/slab_common.c | 4 +++- 3 files cha
7/8
mm/slab: Support disabling KMALLOC_PARTITION_CACHES at boot
Add a kmalloc_partition= early parameter, enabled by default on kernels built with CONFIG_KMALLOC_PARTITION_CACHES=y. Let’s leave kmalloc_type() unchanged since each index simply resolves to the same
8/8
slub_kunit: Add a test for the kmalloc_partition boot parameter
Signed-off-by: Chris Down chris@chrisdown.name — lib/tests/slub_kunit.c | 46 ++++++++++++++++++++++++++++++++++++++++++ mm/slab.h | 4 ++++ mm/slab_common.c | 3 ++- 3 files