From: "刘海燕 (Haiyan Liu)" <haiyan.liu@unisoc.com>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: "周平 (Ping Zhou/9032)" <Ping.Zhou1@unisoc.com>,
"代子为 (Ziwei Dai)" <Ziwei.Dai@unisoc.com>,
"杨丽娜 (Lina Yang)" <lina.yang@unisoc.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
"王双 (Shuang Wang)" <shuang.wang@unisoc.com>,
"Andrey Ryabinin" <ryabinin.a.a@gmail.com>,
"Alexander Potapenko" <glider@google.com>,
"Andrey Konovalov" <andreyknvl@gmail.com>,
"Dmitry Vyukov" <dvyukov@google.com>,
"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
"kasan-dev@googlegroups.com" <kasan-dev@googlegroups.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Martijn Coenen" <maco@android.com>,
"Joel Fernandes" <joelagnelf@nvidia.com>,
"Christian Brauner" <christian@brauner.io>,
"Carlos Llamas" <cmllamas@google.com>,
"Suren Baghdasaryan" <surenb@google.com>,
"Jamie Cunliffe" <Jamie.Cunliffe@arm.com>,
"Catalin Marinas" <catalin.marinas@arm.com>
Subject: 答复: Meet compiled kernel binaray abnormal issue while enabling generic kasan in kernel 6.12 with some default KBUILD_RUSTFLAGS on
Date: Tue, 15 Jul 2025 09:40:30 +0000 [thread overview]
Message-ID: <c34f4f606eb04c38b64e8f3a658cd051@BJMBX01.spreadtrum.com> (raw)
In-Reply-To: <202507150830.56F8U908028199@SHSPAM01.spreadtrum.com>
> -----邮件原件-----
> 发件人: Miguel Ojeda <ojeda@kernel.org>
> 发送时间: 2025年7月15日 4:05
> 收件人: 刘海燕 (Haiyan Liu) <haiyan.liu@unisoc.com>
> 抄送: 周平 (Ping Zhou/9032) <Ping.Zhou1@unisoc.com>; 代子为 (Ziwei Dai) <Ziwei.Dai@unisoc.com>; 杨丽娜 (Lina Yang)
> <lina.yang@unisoc.com>; linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; rust-for-linux@vger.kernel.org; 王双
> (Shuang Wang) <shuang.wang@unisoc.com>; Andrey Ryabinin <ryabinin.a.a@gmail.com>; Alexander Potapenko <glider@google.com>;
> Andrey Konovalov <andreyknvl@gmail.com>; Dmitry Vyukov <dvyukov@google.com>; Vincenzo Frascino <vincenzo.frascino@arm.com>;
> kasan-dev@googlegroups.com; Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Arve Hjønnevåg <arve@android.com>; Todd Kjos
> <tkjos@android.com>; Martijn Coenen <maco@android.com>; Joel Fernandes <joelagnelf@nvidia.com>; Christian Brauner
> <christian@brauner.io>; Carlos Llamas <cmllamas@google.com>; Suren Baghdasaryan <surenb@google.com>; Jamie Cunliffe
> <Jamie.Cunliffe@arm.com>; Catalin Marinas <catalin.marinas@arm.com>
> 主题: Re: Meet compiled kernel binaray abnormal issue while enabling generic kasan in kernel 6.12 with some default KBUILD_RUSTFLAGS
> on
>
>
> 注意: 这封邮件来自于外部。除非你确定邮件内容安全,否则不要点击任何链接和附件。
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender
> and know the content is safe.
>
>
>
> On Mon, 14 Jul 2025 03:12:33 +0000 "刘海燕 (Haiyan Liu)" <haiyan.liu@unisoc.com> wrote:
> >
> > After I delete the rust build flags, the asan.module_ctor binary is right and kasan feature works fine.Could you help check why
> KBUILD_RUSTFLAGS impacts kernel complication with kasan feature enabled and how can this issue fixed?
>
> I assume Rust is enabled in that kernel, right? Or do you mean that somehow removing those lines from the `Makefile` makes the issue go
> away even if Rust is not enabled?
Rust is enabled in kernel, and rustc version is 1.82.0. I want to know why the pacisap/autiasp are not in pair.
> Could you please share your kernel commit and the full configuration? From a quick build arm64 KASAN in v6.12.38, I see the
> `paciasp`/`autiasp` pair in one of the Rust object files:
The commit changes the fragment and diff is:
+CONFIG_CMDLINE="stack_depot_disable=off kasan.stacktrace=on kasan.fault=panic kvm-arm.mode=protected cgroup_disable=pressure"
+CONFIG_KASAN_GENERIC=y
Only two rust-related global variables in fmr.rs and layout.rs have this issue. Their asan.module_ctor complied binaries are wrong.
> 0000000000000000 <asan.module_ctor>:
> 0: d503233f paciasp
> 4: f81f0ffe str x30, [sp, #-0x10]!
> 8: 90000000 adrp x0, 0x0 <asan.module_ctor>
> c: 91000000 add x0, x0, #0x0
> 10: 52800601 mov w1, #0x30 // =48
> 14: 94000000 bl 0x14 <asan.module_ctor+0x14>
> 18: f84107fe ldr x30, [sp], #0x10
> 1c: d50323bf autiasp
> 20: d65f03c0 ret
>
> But I am definitely not an expert at all in this, so Cc'ing KASAN and Android maintainers:
> https://lore.kernel.org/rust-for-linux/4c459085b9ae42bdbf99b6014952b965@BJMBX01.spreadtrum.com/
>
> Cheers,
> Miguel
next prev parent reply other threads:[~2025-07-15 9:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-14 3:12 刘海燕 (Haiyan Liu)
2025-07-14 20:04 ` Miguel Ojeda
[not found] ` <202507150830.56F8U908028199@SHSPAM01.spreadtrum.com>
2025-07-15 9:40 ` 刘海燕 (Haiyan Liu) [this message]
2025-07-15 17:50 ` Miguel Ojeda
2025-07-16 7:01 ` 刘海燕 (Haiyan Liu)
2025-07-16 18:21 ` Carlos Llamas
2025-07-16 20:07 ` Alice Ryhl
2025-07-16 23:19 ` Matthew Maurer
2025-07-17 1:34 ` 答复: " 刘海燕 (Haiyan Liu)
2025-07-17 7:29 ` Miguel Ojeda
2025-07-17 10:38 ` Mark Rutland
2025-07-21 6:10 ` Ard Biesheuvel
2025-07-30 9:44 ` 答复: " 刘海燕 (Haiyan Liu)
2025-07-31 0:57 ` 刘海燕 (Haiyan Liu)
2025-07-17 11:25 刘海燕 (Haiyan Liu)
2025-07-17 13:06 ` Mark Rutland
2025-07-23 6:46 ` 答复: " 刘海燕 (Haiyan Liu)
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=c34f4f606eb04c38b64e8f3a658cd051@BJMBX01.spreadtrum.com \
--to=haiyan.liu@unisoc.com \
--cc=Jamie.Cunliffe@arm.com \
--cc=Ping.Zhou1@unisoc.com \
--cc=Ziwei.Dai@unisoc.com \
--cc=andreyknvl@gmail.com \
--cc=arve@android.com \
--cc=catalin.marinas@arm.com \
--cc=christian@brauner.io \
--cc=cmllamas@google.com \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=joelagnelf@nvidia.com \
--cc=kasan-dev@googlegroups.com \
--cc=lina.yang@unisoc.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=ryabinin.a.a@gmail.com \
--cc=shuang.wang@unisoc.com \
--cc=surenb@google.com \
--cc=tkjos@android.com \
--cc=vincenzo.frascino@arm.com \
/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
all inboxes | Powered by JetHome®