[PATCH] arm64: cpufeature: Don't cpu_enable_mte() when KASAN_GENERIC is active
Yunseong Kim
ysk at kzalloc.com
Fri Oct 10 07:56:34 PDT 2025
Hi Will,
On 10/10/25 9:29 PM, Will Deacon wrote:
> On Thu, Oct 09, 2025 at 08:10:53AM +0900, Yunseong Kim wrote:
>> To summarize my situation, I thought the boot panic issue might be due
>> to incompatibility between MTE and KASAN Generic, so I sent this patch.
>>
>> However, it seems that the problem is related to the call path involving
>> ZERO page. Also, I am curious how it works correctly in other machine.
>>
>> On 10/9/25 7:28 AM, Yunseong Kim wrote:
>>> Hi Andrey,
>>>
>>> On 10/9/25 6:36 AM, Andrey Konovalov wrote:
>>>> On Wed, Oct 8, 2025 at 11:13 PM Yunseong Kim <ysk at kzalloc.com> wrote:
>>>>> [...]
>>>> I do not understand this. Why is Generic KASAN incompatible with MTE?
>>>
>>> My board wouldn't boot on the debian debug kernel, so I enabled
>>> earlycon=pl011,0x40d0000 and checked via the UART console.
>>>
>>>> Running Generic KASAN in the kernel while having MTE enabled (and e.g.
>>>> used in userspace) seems like a valid combination.
>>>
>>> Then it must be caused by something else. Thank you for letting me know.
>>>
>>> It seems to be occurring in the call path as follows:
>>>
>>> cpu_enable_mte()
>>> -> try_page_mte_tagging(ZERO_PAGE(0))
>>> -> VM_WARN_ON_ONCE(folio_test_hugetlb(page_folio(page)));
>>>
>>> https://elixir.bootlin.com/linux/v6.17/source/arch/arm64/include/asm/mte.h#L83
>>
>> -> page_folio(ZERO_PAGE(0))
>> -> (struct folio *)_compound_head(ZERO_PAGE(0))
>>
>> https://elixir.bootlin.com/linux/v6.17/source/include/linux/page-flags.h#L307
>
> Do you have:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?id=f620d66af3165838bfa845dcf9f5f9b4089bf508
>
> ?
>
> Will
Oh, There was a recent patch! Thanks a lot for letting me know, Will.
The current Debian kernel is based on v6.17, so this patch isn’t applied yet.
I should also let the Debian kernel team people know in advance.
I’ll apply and test it, Thanks again, Will!
Best regards,
Yunseong
More information about the linux-arm-kernel
mailing list