Skip to content

arm64: avoid KASAN stack overflows

Mark Rutland linux-arm-kernel 1 version New

Get series with b4
b4 am 20170607161816.GA8330@leverpostej

Versions newest first

  1. v1 Latest0 of 2 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] arm64: avoid KASAN stack overflows
Quoted 5 lines · Andrey Ryabinin
Quoted 4 lines · Mark Rutland

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.

Quoted 7 lines
Quoted 4 lines

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.

This is caused by -fsanitize-address-use-after-scope which is added in gcc 7. Arnd reported that sometimes it causes enormously huge stack growth.

Ah. Sorry for the bogus attribution, then.

Quoted 2 lines

Given that we haven't found any single use-after-scope bug so far, I wouldn't object removing it completely.

FWIW, I saw a single use-after-scope splat when testing with syzkaller (prior to these patches), but that may have been a result of things going wrong after a stack overflow. Unfortuantely I threw away all of the results of that run.

I'll see if anything triggers overnight with this patch.

Otherwise, I'm also happy for use-after-scope checks to be disabled.

Thanks,
Mark.