arm64 KASAN_HW_TAGS panic on non-MTE hardware on 5.12-rc1

Catalin Marinas catalin.marinas at arm.com
Fri Mar 5 17:52:43 GMT 2021


On Fri, Mar 05, 2021 at 05:51:26PM +0000, Catalin Marinas wrote:
> On Fri, Mar 05, 2021 at 06:27:45PM +0100, Andrey Konovalov wrote:
> > On Fri, Mar 5, 2021 at 6:11 PM Catalin Marinas <catalin.marinas at arm.com> wrote:
> > > Enabling CONFIG_KASAN_HW_TAGS and running the resulting kernel on
> > > non-MTE hardware panics with an undefined STG instruction from
> > > mte_set_mem_tag_range():
> > >
> > > ./scripts/faddr2line vmlinux kasan_unpoison_task_stack+0x18/0x40
> > > kasan_unpoison_task_stack+0x18/0x40:
> > > mte_set_mem_tag_range at arch/arm64/include/asm/mte-kasan.h:71
> > > (inlined by) mte_set_mem_tag_range at arch/arm64/include/asm/mte-kasan.h:56
> > > (inlined by) kasan_unpoison at mm/kasan/kasan.h:363
> > > (inlined by) kasan_unpoison_task_stack at mm/kasan/common.c:72
> > 
> > This is weird. kasan_unpoison_task_stack() is only defined when
> > CONFIG_KASAN_STACK is enabled, which shouldn't be enablable for
> > HW_TAGS.
> 
> CONFIG_KASAN=y
> # CONFIG_KASAN_GENERIC is not set
> CONFIG_KASAN_HW_TAGS=y
> CONFIG_KASAN_STACK=1

>From Kconfig:

config KASAN_STACK
	int
	default 1 if KASAN_STACK_ENABLE || CC_IS_GCC
	default 0

and I use gcc.

-- 
Catalin



More information about the linux-arm-kernel mailing list