[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250410130944.GA9003@noisy.programming.kicks-ass.net>
Date: Thu, 10 Apr 2025 15:09:44 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Paweł Anikiel <panikiel@...gle.com>
Cc: Sami Tolvanen <samitolvanen@...gle.com>, Kees Cook <kees@...nel.org>,
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>,
Alice Ryhl <aliceryhl@...gle.com>,
Nathan Chancellor <nathan@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH] x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST
On Thu, Apr 10, 2025 at 02:45:26PM +0200, Peter Zijlstra wrote:
> On Thu, Apr 10, 2025 at 02:36:02PM +0200, Peter Zijlstra wrote:
> > On Thu, Apr 10, 2025 at 11:54:20AM +0000, Paweł Anikiel wrote:
> > > Calling core::fmt::write() from rust code while FineIBT is enabled
> > > results in a kernel panic:
> > > This happens because core::fmt::write() calls
> > > core::fmt::rt::Argument::fmt(), which currently has CFI disabled:
> > >
> > > library/core/src/fmt/rt.rs:
> > > 171 // FIXME: Transmuting formatter in new and indirectly branching to/calling
> > > 172 // it here is an explicit CFI violation.
> > > 173 #[allow(inline_no_sanitize)]
> > > 174 #[no_sanitize(cfi, kcfi)]
> > > 175 #[inline]
> > > 176 pub(super) unsafe fn fmt(&self, f: &mut Formatter<'_>) -> Result {
> > >
Miguel, I cannot find this code in the kernel tree. Is this again
because Rust is not free-standing and relies on external code?
Can you please fix that. Building against external code that is not
under our control is a problem.
Powered by blists - more mailing lists