linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Use larger stacks when KASAN is selected
Date: Wed, 4 Oct 2017 12:39:09 +0100	[thread overview]
Message-ID: <20171004113908.GD23092@leverpostej> (raw)
In-Reply-To: <20171004113130.t76oxehchtfcvbo3@armageddon.cambridge.arm.com>

On Wed, Oct 04, 2017 at 12:31:31PM +0100, Catalin Marinas wrote:
> On Tue, Oct 03, 2017 at 06:25:46PM +0100, Mark Rutland wrote:
> > AddressSanitizer instrumentation can significantly bloat the stack, and
> > with GCC 7 this can result in stack overflows at boot time in some
> > configurations.
> > 
> > We can avoid this by doubling our stack size when KASAN is in use, as is
> > already done on x86 (and has been since KASAN was introduced).
> > Regardless of other patches to decrease KASAN's stack utilization,
> > kernels built with KASAN will always require more stack space than those
> > built without, and we should take this into account.
> > 
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Will Deacon <will.deacon@arm.com>
> > Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> > ---
> >  arch/arm64/include/asm/memory.h | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > In local testing (with KASAN and other options enabled), I've seen a stack
> > depth of 23928 bytes while booting to a prompt with an Ubuntu 14.04 filesystem
> > mounted over NFS. Without KASAN (but with other debug options enabled), this
> > was 7992 bytes.
> > 
> > I wonder if we want to go for 4x rather than 2x...
> 
> Let's hope it's fine for now with 32K stacks. We may run into allocation
> issues with 64K stacks (and without VMAP_STACKS).
> 
> Do you want this patch for 4.14?

If you're happy to take it, that would be great, but otherwise it can
wait for v4.15.

Arguably this fixes the introduction of KASAN to arm64, but I'm not sure
how much we care about backporting this to stable.

Thanks,
Mark.

  reply	other threads:[~2017-10-04 11:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 17:25 [PATCH] arm64: Use larger stacks when KASAN is selected Mark Rutland
2017-10-04 11:31 ` Catalin Marinas
2017-10-04 11:39   ` Mark Rutland [this message]
2017-10-05 15:11     ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171004113908.GD23092@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).