Re: Crash on armv7-a using KASAN

From: Linus Walleij
Date: Tue Oct 15 2024 - 16:55:26 EST


On Tue, Oct 15, 2024 at 7:28 PM Ard Biesheuvel <ardb@xxxxxxxxxx> wrote:

> > From a superficial look, it sounds like it should be possible to extend
> > that to also handle the KASAN shadow of the vmalloc area (which
> > __check_vmalloc_seq() currently doesn't copy), but I'm not sure of
> > exactly when we initialise the shadow for a vmalloc allocation relative
> > to updating vmalloc_seq.
>
> Indeed. It appears both vmalloc_seq() and arch_sync_kernel_mappings()
> need to take the vmalloc shadow into account specifically.

I'm trying to look into that.

> And we may
> also need the dummy read from the stack's shadow in __switch_to - I am
> pretty sure I added that for a reason.

I added that since it was simple: