* [PATCH] ARM: Do not select HAVE_RUST when KASAN is enabled
@ 2026-05-11 8:02 Nathan Chancellor
2026-05-11 8:21 ` Alice Ryhl
2026-05-11 13:22 ` Christian Schrefl
0 siblings, 2 replies; 5+ messages in thread
From: Nathan Chancellor @ 2026-05-11 8:02 UTC (permalink / raw)
To: Russell King, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Christian Schrrefl
Cc: linux-arm-kernel, linux-kernel, rust-for-linux, stable,
Nathan Chancellor
When KASAN is enabled, such as with allmodconfig, the build fails when
building the Rust code with:
error: kernel-address sanitizer is not supported for this target
error: aborting due to 1 previous error
make[4]: *** [rust/Makefile:654: rust/core.o] Error 1
The arm-unknown-linux-gnueabi target does not support KASAN, so avoid
saying Rust is supported when it is enabled.
Cc: stable@vger.kernel.org
Fixes: ccb8ce526807 ("ARM: 9441/1: rust: Enable Rust support for ARMv7")
Link: https://github.com/Rust-for-Linux/linux/issues/1234
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
arch/arm/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 71fc5dd4123f..73e6647bea46 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -136,7 +136,7 @@ config ARM
select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_RSEQ
- select HAVE_RUST if CPU_LITTLE_ENDIAN && CPU_32v7
+ select HAVE_RUST if CPU_LITTLE_ENDIAN && CPU_32v7 && !KASAN
select HAVE_STACKPROTECTOR
select HAVE_SYSCALL_TRACEPOINTS
select HAVE_UID16
---
base-commit: 5d6919055dec134de3c40167a490f33c74c12581
change-id: 20260511-arm-avoid-rust-with-kasan-7670981ef8b5
Best regards,
--
Cheers,
Nathan
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: Do not select HAVE_RUST when KASAN is enabled
2026-05-11 8:02 [PATCH] ARM: Do not select HAVE_RUST when KASAN is enabled Nathan Chancellor
@ 2026-05-11 8:21 ` Alice Ryhl
2026-05-11 9:09 ` Nathan Chancellor
2026-05-11 13:22 ` Christian Schrefl
1 sibling, 1 reply; 5+ messages in thread
From: Alice Ryhl @ 2026-05-11 8:21 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Russell King, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, Christian Schrrefl,
linux-arm-kernel, linux-kernel, rust-for-linux, stable
On Mon, May 11, 2026 at 05:02:44PM +0900, Nathan Chancellor wrote:
> When KASAN is enabled, such as with allmodconfig, the build fails when
> building the Rust code with:
>
> error: kernel-address sanitizer is not supported for this target
>
> error: aborting due to 1 previous error
>
> make[4]: *** [rust/Makefile:654: rust/core.o] Error 1
>
> The arm-unknown-linux-gnueabi target does not support KASAN, so avoid
> saying Rust is supported when it is enabled.
>
> Cc: stable@vger.kernel.org
> Fixes: ccb8ce526807 ("ARM: 9441/1: rust: Enable Rust support for ARMv7")
> Link: https://github.com/Rust-for-Linux/linux/issues/1234
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
I would probably suggest moving the conditions out to a separate
RUSTC_SUPPORTS_ARM config option similar to what I did in commit
d077242d68a3 ("rust: support for shadow call stack sanitizer").
This way it will be simpler to adjust this logic when the target obtains
support for this sanitizer.
Also, we may need the same change for CONFIG_CFI too.
Alice
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: Do not select HAVE_RUST when KASAN is enabled
2026-05-11 8:21 ` Alice Ryhl
@ 2026-05-11 9:09 ` Nathan Chancellor
2026-05-11 9:58 ` Miguel Ojeda
0 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2026-05-11 9:09 UTC (permalink / raw)
To: Alice Ryhl
Cc: Russell King, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, Christian Schrrefl,
linux-arm-kernel, linux-kernel, rust-for-linux, stable
On Mon, May 11, 2026 at 08:21:48AM +0000, Alice Ryhl wrote:
> On Mon, May 11, 2026 at 05:02:44PM +0900, Nathan Chancellor wrote:
> > When KASAN is enabled, such as with allmodconfig, the build fails when
> > building the Rust code with:
> >
> > error: kernel-address sanitizer is not supported for this target
> >
> > error: aborting due to 1 previous error
> >
> > make[4]: *** [rust/Makefile:654: rust/core.o] Error 1
> >
> > The arm-unknown-linux-gnueabi target does not support KASAN, so avoid
> > saying Rust is supported when it is enabled.
> >
> > Cc: stable@vger.kernel.org
> > Fixes: ccb8ce526807 ("ARM: 9441/1: rust: Enable Rust support for ARMv7")
> > Link: https://github.com/Rust-for-Linux/linux/issues/1234
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>
> I would probably suggest moving the conditions out to a separate
> RUSTC_SUPPORTS_ARM config option similar to what I did in commit
> d077242d68a3 ("rust: support for shadow call stack sanitizer").
>
> This way it will be simpler to adjust this logic when the target obtains
> support for this sanitizer.
Sure, I kept it simple for backporting purposes but I don't mind
breaking out the dependencies into their own symbol, even though it
feels like that could be done when support for the sanitizer is
re-enabled, which would truly mirror what you did. No strong opinion
though, so I will send a v2 after giving some time for other comments.
> Also, we may need the same change for CONFIG_CFI too.
I think the dependencies of HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
prevent RUST from being selected when CFI is enabled for ARM, so I don't
think there is a problem there.
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: Do not select HAVE_RUST when KASAN is enabled
2026-05-11 9:09 ` Nathan Chancellor
@ 2026-05-11 9:58 ` Miguel Ojeda
0 siblings, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2026-05-11 9:58 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Alice Ryhl, Russell King, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, Christian Schrrefl,
linux-arm-kernel, linux-kernel, rust-for-linux, stable
On Mon, May 11, 2026 at 11:09 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> Sure, I kept it simple for backporting purposes but I don't mind
> breaking out the dependencies into their own symbol, even though it
> feels like that could be done when support for the sanitizer is
> re-enabled, which would truly mirror what you did. No strong opinion
> though, so I will send a v2 after giving some time for other comments.
I think it is fine either way, especially for a fix, but up to the
KASAN/arm maintainers of course.
Thanks for the patch!
If KASAN or arm maintainers want to pick it up:
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Otherwise I can send it in a fixes PR I will likely need to send later
this cycle, so please let me know!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: Do not select HAVE_RUST when KASAN is enabled
2026-05-11 8:02 [PATCH] ARM: Do not select HAVE_RUST when KASAN is enabled Nathan Chancellor
2026-05-11 8:21 ` Alice Ryhl
@ 2026-05-11 13:22 ` Christian Schrefl
1 sibling, 0 replies; 5+ messages in thread
From: Christian Schrefl @ 2026-05-11 13:22 UTC (permalink / raw)
To: Nathan Chancellor, Russell King, Miguel Ojeda, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Alice Ryhl, Trevor Gross, Danilo Krummrich
Cc: linux-arm-kernel, linux-kernel, rust-for-linux, stable
On 5/11/26 10:02 AM, Nathan Chancellor wrote:
> When KASAN is enabled, such as with allmodconfig, the build fails when
> building the Rust code with:
>
> error: kernel-address sanitizer is not supported for this target
>
> error: aborting due to 1 previous error
>
> make[4]: *** [rust/Makefile:654: rust/core.o] Error 1
>
> The arm-unknown-linux-gnueabi target does not support KASAN, so avoid
> saying Rust is supported when it is enabled.
>
> Cc: stable@vger.kernel.org
> Fixes: ccb8ce526807 ("ARM: 9441/1: rust: Enable Rust support for ARMv7")
> Link: https://github.com/Rust-for-Linux/linux/issues/1234
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Seems fine to me either like this or as Alice mentioned in another reply.
Reviewed-by: Christian Schrefl <chrisi.schrefl@gmail.com>
Cheers,
Christian
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-11 13:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 8:02 [PATCH] ARM: Do not select HAVE_RUST when KASAN is enabled Nathan Chancellor
2026-05-11 8:21 ` Alice Ryhl
2026-05-11 9:09 ` Nathan Chancellor
2026-05-11 9:58 ` Miguel Ojeda
2026-05-11 13:22 ` Christian Schrefl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox