What needs to be done for enabling KMSAN on arm64?

41 views
Skip to first unread message

Juhyung Park

unread,
Mar 6, 2025, 4:31:20 PM3/6/25
to Alexander Potapenko, Marco Elver, Dmitry Vyukov, kasa...@googlegroups.com
Hi everyone,

Since Android kernels enable memory zeroing by default [1], any downstream forks that want to disable memory zeroing for performance reasons need to manually fix quite a lot of uninitialized memory usage.

Some are especially hard to track down that involve userspace daemon erroring out or IOMMU faults.

KASAN and -W(maybe-)uninitialized are both limited in catching uninitialized memory usage. KMSAN seems like the perfect solution for this, and yet it's not ported to arm64 yet.

This was first asked in 2019 [2], and I thought it'd be worth asking again in 2025.

Are there any (wip) progress in arm64? Can we ask upstream for KMSAN arm64 enablement?

Thanks,
Juhyung

Alexander Potapenko

unread,
Mar 19, 2025, 7:15:09 AM3/19/25
to Juhyung Park, Marco Elver, Dmitry Vyukov, kasa...@googlegroups.com
On Thu, Mar 6, 2025 at 10:31 PM Juhyung Park <qkrwn...@gmail.com> wrote:
>
> Hi everyone,
>
> Since Android kernels enable memory zeroing by default [1], any downstream forks that want to disable memory zeroing for performance reasons need to manually fix quite a lot of uninitialized memory usage.
>
> Some are especially hard to track down that involve userspace daemon erroring out or IOMMU faults.
>
> KASAN and -W(maybe-)uninitialized are both limited in catching uninitialized memory usage. KMSAN seems like the perfect solution for this, and yet it's not ported to arm64 yet.
>
> This was first asked in 2019 [2], and I thought it'd be worth asking again in 2025.
>
> Are there any (wip) progress in arm64? Can we ask upstream for KMSAN arm64 enablement?

Hi Juhyung,

Sorry for the late reply.

So far there's been no work on KMSAN support for arm64. There were
some requests, but given that Android is initializing the memory by
default, those were considered low-priority for us.

If you want to contribute to this, you can take a look at the s390
port done by Ilya Leoshkevich:
https://lore.kernel.org/linux-mm/2024062111370...@linux.ibm.com/T/

Feel free to ask further questions, we'll be happy to answer them.

Alex
Reply all
Reply to author
Forward
0 new messages