Re: Crash on armv7-a using KASAN

From: Linus Walleij
Date: Tue Oct 15 2024 - 03:56:15 EST


Hi Clement,

thanks for your report! I looked a bit at it:

On Mon, Oct 14, 2024 at 3:21 PM Clement LE GOFFIC
<clement.legoffic@xxxxxxxxxxx> wrote:

> I have detected a kernel crash in latest kernel on armv7-a when Kasan is
> enabled.
(...)
> Crash log with recent kernel (v6.12-rc3) :
>
> ~ # Insufficient stack space to handle exception!

The crash looks pretty "expected", as you say you start a lot of
parallel processes
and whoops, you run out of memory on the stack. No software can add more
memory to the machine.

KASAN uses a lot of extra memory for intercepting all memory accesses,
nominally one
extra byte per 8 bytes. This is further restricted by the complex
nature of the virtual
memory space on ARM32.

That said, we increase the size of per-thread storage when using KASAN,
THREAD_SIZE_ORDER is 2 instead of 1. Maybe the interrupt stacks need
to be scaled similarly to manage the increased load?

Yours,
Linus Walleij