public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Miguel Ojeda <ojeda@kernel.org>
To: haiyan.liu@unisoc.com
Cc: Ping.Zhou1@unisoc.com, Ziwei.Dai@unisoc.com,
	lina.yang@unisoc.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	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>
Subject: Re: Meet compiled kernel binaray abnormal issue while enabling generic kasan in kernel 6.12 with some default KBUILD_RUSTFLAGS on
Date: Mon, 14 Jul 2025 22:04:30 +0200	[thread overview]
Message-ID: <20250714200431.1917584-1-ojeda@kernel.org> (raw)
In-Reply-To: <4c459085b9ae42bdbf99b6014952b965@BJMBX01.spreadtrum.com>

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?

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:

    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


  reply	other threads:[~2025-07-14 20:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14  3:12 Meet compiled kernel binaray abnormal issue while enabling generic kasan in kernel 6.12 with some default KBUILD_RUSTFLAGS on 刘海燕 (Haiyan Liu)
2025-07-14 20:04 ` Miguel Ojeda [this message]
     [not found] ` <202507150830.56F8U908028199@SHSPAM01.spreadtrum.com>
     [not found]   ` <c34f4f606eb04c38b64e8f3a658cd051@BJMBX01.spreadtrum.com>
2025-07-15 17:50     ` Miguel Ojeda
     [not found]       ` <24e87f60203c443abe7549ce5c0e9e75@BJMBX01.spreadtrum.com>
2025-07-16 18:21         ` Carlos Llamas
2025-07-16 20:07           ` Alice Ryhl
2025-07-16 23:19             ` Matthew Maurer
     [not found]           ` <7afa22cbbb85481cbb3fabb09a58bd63@BJMBX01.spreadtrum.com>
2025-07-17  7:29             ` Miguel Ojeda
2025-07-17 10:38 ` Mark Rutland
2025-07-21  6:10   ` Ard Biesheuvel
  -- strict thread matches above, loose matches on Subject: below --
2025-07-17 11:25 刘海燕 (Haiyan Liu)
2025-07-17 13:06 ` Mark Rutland

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=20250714200431.1917584-1-ojeda@kernel.org \
    --to=ojeda@kernel.org \
    --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=haiyan.liu@unisoc.com \
    --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=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