diff options
author | Alice Ryhl <aliceryhl@google.com> | 2024-09-26 09:38:49 +0000 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2024-09-26 21:27:27 +0200 |
commit | 93e34a0b5c0e79ce765f01fd10f7817863fba23d (patch) | |
tree | 64e66a784e5afa8490135df78717fac04148abc8 /arch | |
parent | af6017b6a315e9102582afb92640221d057f84f6 (diff) | |
download | linux-93e34a0b5c0e79ce765f01fd10f7817863fba23d.tar.gz linux-93e34a0b5c0e79ce765f01fd10f7817863fba23d.tar.bz2 linux-93e34a0b5c0e79ce765f01fd10f7817863fba23d.zip |
rust: KASAN+RETHUNK requires rustc 1.83.0
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
informing LLVM about the mitigation at the module level (it does so at
the function level only currently, which covers most cases, but both
are required), 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@kernel.org>
Closes: https://lore.kernel.org/all/CANiq72myZL4_poCMuNFevtpYYc0V0embjSuKb7y=C+m3vVA_8g@mail.gmail.com/
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240926093849.1192264-1-aliceryhl@google.com
[ Reworded to add the details mentioned in the list. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions