Skip to content

Commit 487e10b

Browse files
ConchuODMa Wupeng
authored and
Ma Wupeng
committed
rust: make mutually exclusive with CFI_CLANG
stable inclusion from stable-v6.6.30 commit 3a9337459645c189a692be0c78bc8a6e5649b7d2 bugzilla: https://gitee.com/openeuler/kernel/issues/I9MPZ8 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3a9337459645c189a692be0c78bc8a6e5649b7d2 -------------------------------- commit 8933cf4651e02853ca679be7b2d978dfcdcc5e0c upstream. On RISC-V and arm64, and presumably x86, if CFI_CLANG is enabled, loading a rust module will trigger a kernel panic. Support for sanitisers, including kcfi (CFI_CLANG), is in the works, but for now they're nightly-only options in rustc. Make RUST depend on !CFI_CLANG to prevent configuring a kernel without symmetrical support for kfi. [ Matthew Maurer writes [1]: This patch is fine by me - the last patch needed for KCFI to be functional in Rust just landed upstream last night, so we should revisit this (in the form of enabling it) once we move to `rustc-1.79.0` or later. Ramon de C Valle also gave feedback [2] on the status of KCFI for Rust and created a tracking issue [3] in upstream Rust. - Miguel ] Fixes: 2f7ab12 ("Kbuild: add Rust support") Cc: [email protected] Signed-off-by: Conor Dooley <[email protected]> Acked-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/rust-for-linux/CAGSQo024u1gHJgzsO38Xg3c4or+JupoPABQx_+0BLEpPg0cOEA@mail.gmail.com/ [1] Link: https://lore.kernel.org/rust-for-linux/CAOcBZOS2kPyH0Dm7Fuh4GC3=v7nZhyzBj_-dKu3PfAnrHZvaxg@mail.gmail.com/ [2] Link: rust-lang/rust#123479 [3] Link: https://lore.kernel.org/r/20240404-providing-emporium-e652e359c711@spud [ Added feedback from the list, links, and used Cc for the tag. ] Signed-off-by: Miguel Ojeda <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: ZhangPeng <[email protected]>
1 parent c3c6850 commit 487e10b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

init/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -2054,6 +2054,7 @@ config RUST
20542054
bool "Rust support"
20552055
depends on HAVE_RUST
20562056
depends on RUST_IS_AVAILABLE
2057+
depends on !CFI_CLANG
20572058
depends on !MODVERSIONS
20582059
depends on !GCC_PLUGINS
20592060
depends on !RANDSTRUCT

0 commit comments

Comments
 (0)