[PATCH v4] hardening: Default randstruct off with rust for better allmodconfig support
Kees Cook
kees at kernel.org
Tue Sep 1 23:07:14 UTC 2026
On Wed, Sep 02, 2026 at 12:59:59AM +0200, Miguel Ojeda wrote:
> On Wed, Sep 2, 2026 at 12:52 AM Mark Brown <broonie at kernel.org> wrote:
> >
> > Currently randstruct does not support rust so we have Kconfig dependencies
> > which prevent rust being enabled when randstruct is. Unfortunately this
> > prevents rust being enabled in allmodconfig, our standard coverage build.
> > randstruct gets turned on by default, then the dependency on !RANDSTRUCT
> > causes rust to get disabled.
> >
> > Work around this by disabling randstruct by default if we have a usable
> > rust toolchain and rust support for the architecture, circular
> > dependencies prevent us directly depending on !RUST. This means we might
> > end up with a configuration that disables both rust and randstruct but
> > hopefully it's more likely go give the expected result.
> >
> > Signed-off-by: Mark Brown <broonie at kernel.org>
>
> I thought this was already applied:
>
> https://git.kernel.org/kees/c/3844a38c9c4a
>
> https://lore.kernel.org/rust-for-linux/178733378275.2181196.3186172911325132761.b4-ty@kernel.org/
>
> But it doesn't seem to be in -next -- that branch isn't merged there I think.
I applied it but the push broke. I've re-arranged things now and push
it; I'll get this sent to Linus this week :)
--
Kees Cook
More information about the Linux-security-module-archive
mailing list