From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Chris Down <chris@chrisdown.name>, Harry Yoo <harry@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Kees Cook <kees@kernel.org>, Marco Elver <elver@google.com>,
GONG Ruiqi <gongruiqi@huaweicloud.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Kieran Bingham <kbingham@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
linux-mm@kvack.org, linux-hardening@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH 0/8] mm/slab: Support selecting slab hardening features at boot
Date: Tue, 27 Oct 2026 09:10:40 +0100 [thread overview]
Message-ID: <16121542-acd5-4727-b64c-f8d519145b63@kernel.org> (raw)
In-Reply-To: <cover.1793086056.git.chris@chrisdown.name>
On 10/27/26 08:35, Chris Down wrote:
> 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=
These two should be only a small cpu overhead, which is why distros
generally enable them [1]. Also the code basically only runs in slowpaths
because percpu caching doesn't use freelists. It's possible the static key
conversion doesn't help anything. You could try to measure the impact, I'd
be surprised perhaps :)
Maybe we should just make them default=y.
> slab_buckets=
> kmalloc_partition=
These are more valid as there's a memory overhead tradeoff.
[1]
https://oracle.github.io/kconfigs/?config=UTS_RELEASE&config=SLAB_FREELIST_RANDOM&config=SLAB_FREELIST_HARDENED
> 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
next prev parent reply other threads:[~2026-10-27 8:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 7:35 Chris Down
2026-10-27 7:35 ` [PATCH 1/8] mm/slub: Support disabling freelist hardening " Chris Down
2026-10-27 7:35 ` [PATCH 2/8] slub_kunit: Add a test for slab_freelist_hardened= Chris Down
2026-10-27 7:35 ` [PATCH 3/8] mm/slub: Support disabling freelist randomisation at boot Chris Down
2026-10-27 7:35 ` [PATCH 4/8] slub_kunit: Add a test for slab_freelist_random= Chris Down
2026-10-27 7:35 ` [PATCH 5/8] mm/slab: Support disabling SLAB_BUCKETS at boot Chris Down
2026-10-27 7:36 ` [PATCH 6/8] slub_kunit: Add a test for the slab_buckets boot parameter Chris Down
2026-10-27 7:36 ` [PATCH 7/8] mm/slab: Support disabling KMALLOC_PARTITION_CACHES at boot Chris Down
2026-10-27 7:36 ` [PATCH 8/8] slub_kunit: Add a test for the kmalloc_partition boot parameter Chris Down
2026-10-27 8:10 ` Vlastimil Babka (SUSE) [this message]
2026-10-27 18:31 ` [PATCH 0/8] mm/slab: Support selecting slab hardening features at boot Harry Yoo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16121542-acd5-4727-b64c-f8d519145b63@kernel.org \
--to=vbabka@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=chris@chrisdown.name \
--cc=cl@gentwo.org \
--cc=corbet@lwn.net \
--cc=elver@google.com \
--cc=gongruiqi@huaweicloud.com \
--cc=hao.li@linux.dev \
--cc=harry@kernel.org \
--cc=jan.kiszka@siemens.com \
--cc=kbingham@kernel.org \
--cc=kees@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®