From: Marco Elver <elver@google.com>
To: elver@google.com, Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com,
Arnd Bergmann <arnd@kernel.org>,
Christoph Hellwig <hch@infradead.org>,
Guenter Roeck <linux@roeck-us.net>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Aleksandr Nogikh <nogikh@google.com>,
Alexander Potapenko <glider@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Taras Madan <tarasmadan@google.com>,
linux-mm@kvack.org, llvm@lists.linux.dev
Subject: Re: [PATCH] kasan: double -Wframe-larger-than threshold if KASAN
Date: Thu, 9 Sep 2021 13:46:01 +0200 [thread overview]
Message-ID: <CANpmjNOHG3z7qPKWBukjqHC6f1pxbdR1WOMUhsij9whyx0W=VQ@mail.gmail.com> (raw)
In-Reply-To: <20210909104925.809674-1-elver@google.com>
On Thu, 9 Sept 2021 at 12:49, Marco Elver <elver@google.com> wrote:
> All architectures at least double stack size when using one of the KASAN
> software modes that rely on compiler instrumentation.
>
> Until now, warnings emitted by -Wframe-larger-than could easily be
> ignored, as we would still get a working kernel.
>
> However, with the introduction of -Werror (CONFIG_WERROR=y), it makes
> sense to at least double the -Wframe-larger-than threshold for
> software-based KASAN modes to reflect the already increased stack sizes
> when building a kernel with KASAN enabled.
>
> Link: https://lkml.kernel.org/r/YTbOs13waorzamZ6@Ryzen-9-3900X.localdomain
> Signed-off-by: Marco Elver <elver@google.com>
FWIW, there's still no consensus if this is what we want, and the
discussion continues at:
https://lkml.kernel.org/r/CANpmjNPBdx4b7bp=reNJPMzSNetdyrk+503_1LLoxNMYwUhSHg@mail.gmail.com
> ---
> lib/Kconfig.debug | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index ed4a31e34098..2055bbb6724a 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -345,6 +345,8 @@ endif # DEBUG_INFO
> config FRAME_WARN
> int "Warn for stack frames larger than"
> range 0 8192
> + default 4096 if 64BIT && (KASAN_GENERIC || KASAN_SW_TAGS)
> + default 2048 if !64BIT && (KASAN_GENERIC || KASAN_SW_TAGS)
> default 2048 if GCC_PLUGIN_LATENT_ENTROPY
> default 1536 if (!64BIT && PARISC)
> default 1024 if (!64BIT && !PARISC)
> --
> 2.33.0.153.gba50c8fa24-goog
>
prev parent reply other threads:[~2021-09-09 11:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 10:49 Marco Elver
2021-09-09 11:46 ` Marco Elver [this message]
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='CANpmjNOHG3z7qPKWBukjqHC6f1pxbdR1WOMUhsij9whyx0W=VQ@mail.gmail.com' \
--to=elver@google.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=arnd@kernel.org \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=hch@infradead.org \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@roeck-us.net \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nogikh@google.com \
--cc=tarasmadan@google.com \
/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