Re: [PATCH v3 0/6] mm/slab: Support selecting slab hardening features at boot

From: Chris Down

Date: Sun Nov 29 2026 - 00:21:22 EST


Hi Vlastimil,

Vlastimil Babka (SUSE) writes:
>I'm not thrilled about the "default to on". We usually do these features
>opt-in. Now our distro kernel would likely need to have these "disable this"
>options in the default command line, with documentation to remove it for a
>hardened setup.
>
>But yeah doing it opt-in, the hardened setups would now have to start
>passing the extra params to enable this, even if until now enabling the
>config option was enough. Also not great, but we can argue they are still
>the minority?
>
>Of course there's always the possibility of adding another _DEFAUT_ON
>configs. Not great either. Sigh.

Yes, it is ugly. Given that Harry asked for one of those [1], how about
a single SLAB_HARDENING_DEFAULT_ON for both features in v4? With it set
to n, a distro kernel can build them in and a hardened setup only needs
to add slab_hardening=on (slab_hardening= will replace slab_buckets=
and kmalloc_partition= in v4, as Marco suggested [2]).

It can still default to y in order that existing configs don't quietly lose
these features. The downside is that SLAB_BUCKETS defaults to
SLAB_FREELIST_HARDENED, which this series makes default y, so a defconfig
kernel would get the buckets built in and on at boot. Or would you rather
have n anyway, with hardening.config setting it to y?

Thanks!

Chris

[1] https://lore.kernel.org/r/avdbfEfQHpF9Ez-e@thinkstation
[2] https://lore.kernel.org/r/CANpmjNP0cWB_670hYj7p+Dd=do1qEu4XHeW+c7sTv-MXi0UBTg@xxxxxxxxxxxxxx