linux/arch
Conor Dooley dc15450a5b rust: cfi: only 64-bit arm and x86 support CFI_CLANG
commit 812258ff41 upstream.

The kernel uses the standard rustc targets for non-x86 targets, and out
of those only 64-bit arm's target has kcfi support enabled. For x86, the
custom 64-bit target enables kcfi.

The HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC config option that allows
CFI_CLANG to be used in combination with RUST does not check whether the
rustc target supports kcfi. This breaks the build on riscv (and
presumably 32-bit arm) when CFI_CLANG and RUST are enabled at the same
time.

Ordinarily, a rustc-option check would be used to detect target support
but unfortunately rustc-option filters out the target for reasons given
in commit 46e24a545c ("rust: kasan/kbuild: fix missing flags on first
build"). As a result, if the host supports kcfi but the target does not,
e.g. when building for riscv on x86_64, the build would remain broken.

Instead, make HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC depend on the only
two architectures where the target used supports it to fix the build.

CC: stable@vger.kernel.org
Fixes: ca627e6365 ("rust: cfi: add support for CFI_CLANG with Rust")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250908-distill-lint-1ae78bcf777c@spud
Signed-off-by: Paul Walmsley <pjw@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-10-23 16:20:18 +02:00
..
alpha alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support 2025-03-22 12:54:15 -07:00
arc ARC: build: Try to guess GCC variant of cross compiler 2025-01-09 13:33:47 +01:00
arm ARM: OMAP2+: pm33xx-core: ix device node reference leaks in amx3_idle_init 2025-10-19 16:33:45 +02:00
arm64 arm64: mte: Do not flag the zero page as PG_mte_tagged 2025-10-19 16:34:02 +02:00
csky of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify 2024-12-05 14:01:32 +01:00
hexagon hexagon: Fix unbalanced spinlock in die() 2025-02-08 09:58:11 +01:00
loongarch LoongArch: Init acpi_gbl_use_global_lock to false 2025-10-19 16:33:39 +02:00
m68k m68k: Fix lost column on framebuffer debug console 2025-08-28 16:30:54 +02:00
microblaze of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify 2024-12-05 14:01:32 +01:00
mips mips: lantiq: xway: sysctrl: rename the etop node 2025-09-04 15:31:43 +02:00
nios2 of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify 2024-12-05 14:01:32 +01:00
openrisc of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify 2024-12-05 14:01:32 +01:00
parisc parisc: Remove spurious if statement from raw_copy_from_user() 2025-10-19 16:33:52 +02:00
powerpc powerpc/pseries/msi: Fix potential underflow and leak issue 2025-10-19 16:33:52 +02:00
riscv riscv, bpf: Sign extend struct ops return values properly 2025-10-15 12:00:01 +02:00
s390 s390/bpf: Write back tail call counter for BPF_TRAMP_F_CALL_ORIG 2025-10-19 16:34:05 +02:00
sh sh: Do not use hyphen in exported variable name 2025-08-15 12:13:56 +02:00
sparc sparc: fix error handling in scan_one_device() 2025-10-19 16:33:53 +02:00
um um: Fix FD copy size in os_rcv_fd_msg() 2025-09-25 11:13:42 +02:00
x86 x86/kvm: Force legacy PCI hole to UC when overriding MTRRs for TDX/SNP 2025-10-19 16:34:02 +02:00
xtensa xtensa: simdisk: add input size check in proc_write_simdisk 2025-10-19 16:33:53 +02:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig rust: cfi: only 64-bit arm and x86 support CFI_CLANG 2025-10-23 16:20:18 +02:00