The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ada Couprie Diaz <ada.coupriediaz@arm.com>
To: "Qun-wei Lin (林群崴)" <Qun-wei.Lin@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"Andrew Yang (楊智強)" <Andrew.Yang@mediatek.com>,
	"Chinwen Chang (張錦文)" <chinwen.chang@mediatek.com>,
	"Casper Li (李中榮)" <casper.li@mediatek.com>,
	"andreyknvl@google.com" <andreyknvl@google.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"dvyukov@google.com" <dvyukov@google.com>,
	"vincenzo.frascino@arm.com" <vincenzo.frascino@arm.com>,
	"Ada Couprie Diaz" <ada.coupriediaz@arm.com>
Subject: Re: [BUG] arm64: KASAN + KASLR may cause reserved page to be released during module loading
Date: Fri, 5 Sep 2025 15:30:22 +0100	[thread overview]
Message-ID: <cc9b8e02-e287-40c8-ad9c-34efd5e5e3f6@arm.com> (raw)
In-Reply-To: <6065525d47bf338646d53182b9bbc4a25ccfda82.camel@mediatek.com>

Hi,

On 04/08/2025 15:03, Qun-wei Lin (林群崴) wrote:
> Hi,
>   
> We have encountered a kernel panic on arm64 when loading modules with
> both KASAN and KASLR enabled.
>   
> Kernel version:
> 6.12
> (also reproducible on 6.6-based Android common kernel)
>   
> Config:
> CONFIG_KASAN=y
> CONFIG_KASAN_GENERIC=y
> CONFIG_KASAN_VMALLOC=y
> CONFIG_RANDOMIZE_BASE=y
> # CONFIG_RANDOMIZE_MODULE_REGION_FULL is not set
>   
> Reproducible:
> ~50% of the time, when loading any module with Generic KASAN + KASLR
> enabled.
>   
> The kernel panic log is as follows:
> [...]
> Comm:kworker/4:1 Tainted: G          OE      6.12.23-android16-5-
> g1e57f0e5996f-4k #1 eee834a579887c0f97d696d30c786233f4fbfcdf
> [...]
>
> If I disable KASLR, the issue does not occur.
With the context provided I was not able to reproduce the issue
when testing defconfig + generic KASAN on the following kernels :
- v6.17-rc4
- v6.12.23 Upstream
- v6.12.23 Android[0]
- v6.12.23 Upstream, compiled with LLVM
- v6.12.23 Android[0], compiled with LLVM

(I tried to match the version that appears in your trace)

I tested on both QEMU/KVM and hardware (AMD Seattle), by loading
and unloading an out-of-tree kernel module repeatedly (an APFS driver[1]),
with no issues on either for all tested kernels.
>   
> We are not certain which specific patch introduced this issue, but we
> have confirmed that it does not occur on the Android common kernel 6.1
> The problem was first observed after upgrading to 6.6-based kernels.
>   
> Any suggestions or guidance would be appreciated.
> Thank you.
There's not much information to go off of here, my questions would be :
- Are you able to reproduce on an upstream kernel ?
   (Be it from kernel.org or a "base" Android kernel, like [0])
- Are you able to reproduce under publicly available emulators ?
- Are you able to reproduce with specific, public modules ?
   (Something available in Debian[2] for example)
- Which compiler and version are you using ?

It is a bit of work, I'm aware, but given I didn't manage to reproduce
the issue, it would be useful to have as much info on the context
so either we might be able to reproduce, or you might be able to
pinpoint the source on your side a bit better !

I have not seen any other reports since yours, nor did I see any patch/fix
that seemed relevant, so I don't have much more to suggest sadly ;
others might.
> Best Regards,
>   
>   
> 林群崴 (Qun-wei Lin)
> Qun-wei.Lin@mediatek.com
Thanks in advance,
Best regards
Ada


[0]: 
https://android.googlesource.com/kernel/common/+/refs/tags/android16-6.12-2025-06_r5
[1]: https://github.com/linux-apfs/linux-apfs-rw/
[2]: 
https://packages.debian.org/search?keywords=-dkms&searchon=names&suite=trixie&section=all


  reply	other threads:[~2025-09-05 14:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-04 14:03 [BUG] arm64: KASAN + KASLR may cause reserved page to be released during module loading Qun-wei Lin (林群崴)
2025-09-05 14:30 ` Ada Couprie Diaz [this message]
2025-09-24 12:41   ` Qun-wei Lin (林群崴)
2025-09-24 18:18     ` Yang Shi

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=cc9b8e02-e287-40c8-ad9c-34efd5e5e3f6@arm.com \
    --to=ada.coupriediaz@arm.com \
    --cc=Andrew.Yang@mediatek.com \
    --cc=Qun-wei.Lin@mediatek.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=casper.li@mediatek.com \
    --cc=catalin.marinas@arm.com \
    --cc=chinwen.chang@mediatek.com \
    --cc=dvyukov@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --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