From: Alice Ryhl <aliceryhl@google.com>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>, Miguel Ojeda <ojeda@kernel.org>
Cc: "Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
rust-for-linux@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] rust: kasan/kbuild: fix rustc-option when cross-compiling
Date: Tue, 5 May 2026 12:02:09 +0000 [thread overview]
Message-ID: <afncQeU7-W-7T1sZ@google.com> (raw)
In-Reply-To: <20260504-rustc-option-cross-v1-1-09f2726b680f@google.com>
On Mon, May 04, 2026 at 12:57:37PM +0000, Alice Ryhl wrote:
> The above scenario actually also fails without -Zfixed-x18 since the
> SW_TAGS sanitizer itself is aarch64-specific. But it's a problem with
> normal KASAN too because of -Zfixed-x18.
Correction: No, this is not actually the case. Despite being
aarch64-specific, the SW_TAGS option does work correctly here.
When rustc-option is invoked by Makefile.kasan, the
-Zsanitizer=kernel-hwaddress flag is present only in RUSTFLAGS_KASAN and
not in KBUILD_RUSTFLAGS, so it does not get included in the RUSTC
invocation. Therefore, even though KASAN_SW_TAGS is aarch64-specific, it
will correctly check the -Cllvm-args flags.
I got this wrong because when checking it because I disabled -Zfixed-x18
but not CONFIG_ARM64_BTI_KERNEL, which adds -Zbranch-protection. This
option causes the same problem.
Alice
prev parent reply other threads:[~2026-05-05 12:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 12:57 [PATCH] rust: kasan/kbuild: fix rustc-option when cross-compiling Alice Ryhl
2026-05-05 12:02 ` Alice Ryhl [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=afncQeU7-W-7T1sZ@google.com \
--to=aliceryhl@google.com \
--cc=a.hindborg@kernel.org \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=bp@alien8.de \
--cc=dakr@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=gary@garyguo.net \
--cc=hpa@zytor.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=tmgross@umich.edu \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox