mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "刘海燕 (Haiyan Liu)" <haiyan.liu@unisoc.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"周平 (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: Wed, 16 Jul 2025 07:01:29 +0000	[thread overview]
Message-ID: <24e87f60203c443abe7549ce5c0e9e75@BJMBX01.spreadtrum.com> (raw)
In-Reply-To: <CANiq72=v6jkOasLiem7RXe-WUSg9PkNqrZneeMOTi1pzwXuHYg@mail.gmail.com>



> -----邮件原件-----
> 发件人: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
> 发送时间: 2025年7月16日 1:51
> 收件人: 刘海燕 (Haiyan Liu) <haiyan.liu@unisoc.com>
> 抄送: Miguel Ojeda <ojeda@kernel.org>; 周平 (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 Tue, Jul 15, 2025 at 11:41 AM 刘海燕 (Haiyan Liu) <haiyan.liu@unisoc.com> wrote:
> >
> > The commit changes the fragment and diff is:
> 
> An Android engineer should know how to handle that, but if you are reporting upstream, it is best to try to reproduce the issue with the
> upstream kernels (e.g. arm64 is not in 6.6.y) and provide the full kernel config used.
> 
> > Only two rust-related global variables in fmr.rs and layout.rs have this issue. Their asan.module_ctor complied binaries are wrong.
> 
> I am not sure what you mean by `fmr.rs`. As for `layout.rs`, that is in the `kernel` crate in 6.12.y -- isn't there a single `asan.module_ctor`
> per TU? Which object file are you referring to? I get the pair for my `rust/kernel.o`.

  NSX:FFFFFFC0800A7C94|F800865E  asan.module_ctor:   str     x30,[x18],#0x8   ; x30,[x18],#8
   NSX:FFFFFFC0800A7C98|F81F0FFE                      str     x30,[sp,#-0x10]!   ; x30,[sp,#-16]!
   NSX:FFFFFFC0800A7C9C|F00240A0                      adrp    x0,0xFFFFFFC0848BE000
   NSX:FFFFFFC0800A7CA0|911D8000                      add     x0,x0,#0x760     ; x0,x0,#1888
   NSX:FFFFFFC0800A7CA4|52803D61                      mov     w1,#0x1EB        ; w1,#491
   NSX:FFFFFFC0800A7CA8|94233816                      bl      0xFFFFFFC080975D00   ; __asan_register_globals
   NSX:FFFFFFC0800A7CAC|F84107FE                      ldr     x30,[sp],#0x10   ; x30,[sp],#16
   NSX:FFFFFFC0800A7CB0|D50323BF                      autiasp
   NSX:FFFFFFC0800A7CB4|D65F03C0                      ret
The first __asan_global struct value is 
 ENAXI:FFFFFFC0848BE760|>FFFFFFC082EDB180 000000000000005F ........_.......
 ENAXI:FFFFFFC0848BE770| 0000000000000080 FFFFFFC0836DC431 ........1.m.....
 ENAXI:FFFFFFC0848BE780| FFFFFFC082EEC780 0000000000000000 ................
 ENAXI:FFFFFFC0848BE790| 0000000000000000 FFFFFFFFFFFFFFFF ................
The address of the global is 0xFFFFFFC082EDB180 which value is '/proc/self/cwd/prebuilts/rust/linux-x86/1.82.0/lib/rustlib/src/rust/library/core/src/num/fmt.rs' and its viewinfo is 'vmlinux\Global\__unnamed_357'
The original size of the global is 0x5F
The name of the global is kmalloc-2k
The module name of the global is 'core.27758904ccee4c80-cgu.o'

   NSX:FFFFFFC0800A7D4C|F800865E  asan.mod.:str     x30,[x18],#0x8   ; x30,[x18],#8
   NSX:FFFFFFC0800A7D50|F81F0FFE            str     x30,[sp,#-0x10]!   ; x30,[sp,#-16]!
   NSX:FFFFFFC0800A7D54|F00240E0            adrp    x0,0xFFFFFFC0848C6000
   NSX:FFFFFFC0800A7D58|912E8000            add     x0,x0,#0xBA0     ; x0,x0,#2976
   NSX:FFFFFFC0800A7D5C|52800961            mov     w1,#0x4B         ; w1,#75
   NSX:FFFFFFC0800A7D60|942337E8            bl      0xFFFFFFC080975D00   ; __asan_register_globals
   NSX:FFFFFFC0800A7D64|F84107FE            ldr     x30,[sp],#0x10   ; x30,[sp],#16
   NSX:FFFFFFC0800A7D68|D50323BF            autiasp
   NSX:FFFFFFC0800A7D6C|D65F03C0            ret
The second __asan_global struct value is 
   NSD:FFFFFFC0848C6BA0|>FFFFFFC082EECA80 0000000000000020 ........ .......
   NSD:FFFFFFC0848C6BB0| 0000000000000040 FFFFFFC0836DC431 @.......1.m.....
   NSD:FFFFFFC0848C6BC0| FFFFFFC082EEDA80 0000000000000000 ................
   NSD:FFFFFFC0848C6BD0| 0000000000000000 FFFFFFFFFFFFFFFF ................
The address of the global is 0xFFFFFFC082EECA80 which value is 0 and its viewinfo is '<&usize_as_core::f..vmlinux\kernel_9a6cb9fd7c8dfd66_cgu\<&usize_as_core::fmt::Debug>::{vtable}'
The original size of the global is 0x20
The name of the global is kmalloc-2k
The module name of the global is 'kernel.9a6cb9fd7c8dfd66-cgu.o'

> Cheers,
> Miguel

  reply	other threads:[~2025-07-16  7:01 UTC|newest]

Thread overview: 16+ 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)
2025-07-15 17:50     ` Miguel Ojeda
2025-07-16  7:01       ` 刘海燕 (Haiyan Liu) [this message]
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

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=24e87f60203c443abe7549ce5c0e9e75@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=miguel.ojeda.sandonis@gmail.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®