Re: [PATCH] x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST

From: Paweł Anikiel
Date: Fri May 09 2025 - 05:12:12 EST


On Fri, May 9, 2025 at 11:04 AM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Fri, May 9, 2025 at 10:46 AM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
> >
> > Actually ... I don't think putting it on CFI_AUTO_DEFAULT the right
> > approach.
> >
> > Shouldn't the depends on clause go on `config FINEIBT` instead? After
> > all, the current patch just means that you can't make FineIBT the
> > default option. But you can still pass kcfi=fineibt on boot to enble
> > FineIBT which would result in the same crash.
>
> I thought the intention was to avoid disabling FineIBT at config time:
> https://lore.kernel.org/all/202504161442.66CE2596@keescook/

I think you mean enabling FineIBT - yes, this patch does exactly that,
it's still possible to enable it by hand with cfi=

> If another approach is needed, then we can change it on top if that is
> OK (I am about to submit the PR).

Putting it on CONFIG_FINEIBT was my initial idea, but it turns out
that this creates a dependency cycle in Kconfig:

error: recursive dependency detected!
symbol RUST depends on CALL_PADDING
symbol CALL_PADDING is selected by FINEIBT
symbol FINEIBT depends on RUST

Not sure if it's possible to make it work.