[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <324d6a90-8f9a-4916-981b-ac1253f5057b@foss.st.com>
Date: Tue, 15 Oct 2024 12:35:08 +0200
From: Clement LE GOFFIC <clement.legoffic@...s.st.com>
To: Linus Walleij <linus.walleij@...aro.org>
CC: Russell King <linux@...linux.org.uk>,
"Russell King (Oracle)"
<rmk+kernel@...linux.org.uk>,
Kees Cook <kees@...nel.org>,
AngeloGioacchino
Del Regno <angelogioacchino.delregno@...labora.com>,
Mark Brown
<broonie@...nel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
Ard Biesheuvel <ardb@...nel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
Antonio Borneo
<antonio.borneo@...s.st.com>
Subject: Re: Crash on armv7-a using KASAN
On 10/15/24 09:55, Linus Walleij wrote:> On Mon, Oct 14, 2024 at 3:21 PM
Clement LE GOFFIC
> <clement.legoffic@...s.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
Powered by blists - more mailing lists