lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202505090933.9DA60728@keescook>
Date: Fri, 9 May 2025 09:34:25 -0700
From: Kees Cook <kees@...nel.org>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Paweł Anikiel <panikiel@...gle.com>,
	Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Sami Tolvanen <samitolvanen@...gle.com>,
	Alex Gaynor <alex.gaynor@...il.com>, Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	Ingo Molnar <mingo@...hat.com>,
	Josh Poimboeuf <jpoimboe@...nel.org>,
	Masahiro Yamada <masahiroy@...nel.org>,
	Miguel Ojeda <ojeda@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Nathan Chancellor <nathan@...nel.org>, x86@...nel.org,
	linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
	Matthew Maurer <mmaurer@...gle.com>,
	Ramon de C Valle <rcvalle@...gle.com>
Subject: Re: [PATCH] x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST

On Fri, May 09, 2025 at 09:39:37AM +0000, Alice Ryhl wrote:
> On Fri, May 09, 2025 at 11:11:48AM +0200, Paweł Anikiel wrote:
> > On Fri, May 9, 2025 at 11:04 AM Miguel Ojeda
> > <miguel.ojeda.sandonis@...il.com> wrote:
> > >
> > > On Fri, May 9, 2025 at 10:46 AM Alice Ryhl <aliceryhl@...gle.com> 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.
> 
> To fix that, we probably have to do one of:
> 
> Option 1: Upgrade the rustc MSRV past 1.81 and drop the depends on
>           CALL_PADDING.
> 
> Option 2: Split `config FINEIBT` into two options:
> 
> config HAVE_FINEIBT
> 	def_bool y
> 	depends on X86_KERNEL_IBT && CFI_CLANG && MITIGATION_RETPOLINE
> 	depends on !RUST || RUSTC_VERSION >= 108800
> 
> config FINEIBT
> 	bool "Accept cfi=fineibt option at boot"
> 	depends on HAVE_FINEIBT
> 	select CALL_PADDING

Right -- if you want to make FINEIBT unselectable, this will need some
plumbing. Right now, it's kind of tied in with the hash shuffling, so
it'll need more than just a Kconfig change to properly split it.

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ