Crash on armv7-a using KASAN
Clement LE GOFFIC
clement.legoffic at foss.st.com
Tue Oct 15 03:35:08 PDT 2024
On 10/15/24 09:55, Linus Walleij wrote:> On Mon, Oct 14, 2024 at 3:21 PM
Clement LE GOFFIC
> <clement.legoffic at foss.st.com> 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?
Hi Linus,
Thanks for your reply.
Once I found the issue in latest kernel, with Antonio we firstly tried
to increase the stack size, but it kept crashing.
Then we identified the offending commit and we noticed that it does not
change at all the stack layout.
In fact Ard patch only modifies the way to unwind frames for backtrace.
As far as we understand, KASAN enabled causes the generation of several
backtraces (hashed) on alloc and free to track all the allocation.
The offending commit seams responsible of the crash due to incorrect unwind.
Best regards,
Clément
More information about the linux-arm-kernel
mailing list