linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: avoid KASAN stack overflows
@ 2017-06-07 15:35 Mark Rutland
  2017-06-07 15:35 ` [PATCH 1/2] arm64: avoid open-coding THREAD_SIZE{,_ORDER} Mark Rutland
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mark Rutland @ 2017-06-07 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

I recently tried building the kernel with a GCC 7.1.0 toolchain, and
encountered a number of new and surprising failures on kernels buitl with
KASAN.

It looks like this is due to stack instrumentation, which my prior toolchain
didn't support. KASAN's stack instrumentation significantly bloats the stack
significantly, leading to stack overflows and subsequent failures as a result
of the data corruption they cause.

These patches avoid the issue by doubling the stack size for kernels built with
KASAN, as is already done for x86.

I've built and booted 4K and 64K kernels with these patches applied (and with
KASAN enabled), and so far I haven't seen stack overflows when testing with
Syzkaller.

Thanks,
Mark.

Mark Rutland (2):
  arm64: avoid open-coding THREAD_SIZE{,_ORDER}
  arm64: use larger stacks for KASAN

 arch/arm64/include/asm/thread_info.h | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-07 19:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-07 15:35 [PATCH 0/2] arm64: avoid KASAN stack overflows Mark Rutland
2017-06-07 15:35 ` [PATCH 1/2] arm64: avoid open-coding THREAD_SIZE{,_ORDER} Mark Rutland
2017-06-07 15:35 ` [PATCH 2/2] arm64: use larger stacks for KASAN Mark Rutland
2017-06-07 16:12 ` [PATCH 0/2] arm64: avoid KASAN stack overflows Andrey Ryabinin
2017-06-07 16:18   ` Mark Rutland
2017-06-07 19:54     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).