[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72k9ihcNNRkiGW4us1F_cQuotRFA9_8iJuCMUJnEjbKzrw@mail.gmail.com>
Date: Thu, 26 Sep 2024 23:19:06 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: ojeda@...nel.org, a.hindborg@...sung.com, alex.gaynor@...il.com,
benno.lossin@...ton.me, bjorn3_gh@...tonmail.com, boqun.feng@...il.com,
bp@...en8.de, dave.hansen@...ux.intel.com, gary@...yguo.net, hpa@...or.com,
jpoimboe@...nel.org, linux-kernel@...r.kernel.org, masahiroy@...nel.org,
mingo@...hat.com, nathan@...nel.org, nicolas@...sle.eu,
patches@...ts.linux.dev, peterz@...radead.org, rust-for-linux@...r.kernel.org,
tglx@...utronix.de, x86@...nel.org
Subject: Re: [PATCH] rust: KASAN+RETHUNK requires rustc 1.83.0
On Thu, Sep 26, 2024 at 11:39 AM Alice Ryhl <aliceryhl@...gle.com> wrote:
>
> When enabling both KASAN and RETHUNK, objtool emits the following
> warnings:
>
> rust/core.o: warning: objtool: asan.module_ctor+0x13: 'naked' return found in MITIGATION_RETHUNK build
> rust/core.o: warning: objtool: asan.module_dtor+0x13: 'naked' return found in MITIGATION_RETHUNK build
>
> This is caused by the -Zfunction-return=thunk-extern flag in rustc not
> properly informing LLVM about the mitigation, which means that the KASAN
> functions asan.module_ctor and asan.module_dtor are generated without
> the rethunk mitigation.
>
> The other mitigations that we enabled for Rust (SLS, RETPOLINE) do not
> have the same bug, as they're being applied through the target-feature
> functionality instead.
>
> This is being fixed for rustc 1.83.0, so update Kconfig to reject this
> configuration on older compilers.
>
> Link: https://github.com/rust-lang/rust/pull/130824
> Fixes: d7868550d573 ("x86/rust: support MITIGATION_RETHUNK")
> Reported-by: Miguel Ojeda <ojeda@...nel.org>
> Closes: https://lore.kernel.org/all/CANiq72myZL4_poCMuNFevtpYYc0V0embjSuKb7y=C+m3vVA_8g@mail.gmail.com/
> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
Applied to `rust-fixes` -- thanks!
Cheers,
Miguel
Powered by blists - more mailing lists