From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Andrey Konovalov <andreyknvl@google.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
Alexander Potapenko <glider@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
kasan-dev@googlegroups.com, Kostya Serebryany <kcc@google.com>,
Evgeniy Stepanov <eugenis@google.com>,
Nick Desaulniers <ndesaulniers@google.com>,
Stephen Hines <srhines@google.com>,
Pirama Arumuga Nainar <pirama@google.com>,
Manoj Gupta <manojgupta@google.com>,
Greg Hackmann <ghackmann@google.com>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2] kasan: don't emit builtin calls when sanitization is off
Date: Tue, 23 Jan 2018 12:35:13 +0300 [thread overview]
Message-ID: <9e61ea96-e10e-e200-e88d-51fc202c36c9@virtuozzo.com> (raw)
In-Reply-To: <20180122182047.1da66312c5d94cb4632efabd@linux-foundation.org>
On 01/23/2018 05:20 AM, Andrew Morton wrote:
> On Fri, 19 Jan 2018 18:58:12 +0100 Andrey Konovalov <andreyknvl@google.com> wrote:
>
>> With KASAN enabled the kernel has two different memset() functions, one
>> with KASAN checks (memset) and one without (__memset). KASAN uses some
>> macro tricks to use the proper version where required. For example memset()
>> calls in mm/slub.c are without KASAN checks, since they operate on poisoned
>> slab object metadata.
>>
>> The issue is that clang emits memset() calls even when there is no memset()
>> in the source code. They get linked with improper memset() implementation
>> and the kernel fails to boot due to a huge amount of KASAN reports during
>> early boot stages.
>>
>> The solution is to add -fno-builtin flag for files with KASAN_SANITIZE := n
>> marker.
>
> This clashes somewhat with Arnd's asan-rework-kconfig-settings.patch.
> Could you two please put heads together and decide what we want for a
> final result?
>
> Meanwhile I'll "fix" the reject with
>
> +ifdef CONFIG_KASAN_EXTRA
> CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope)
> +endif
>
Looks correct.
next prev parent reply other threads:[~2018-01-23 9:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 17:58 [PATCH v2] kasan: don't emit builtin calls when sanitization is off Andrey Konovalov
2018-01-19 19:06 ` Nick Desaulniers
2018-01-19 19:08 ` Nick Desaulniers
2018-01-22 17:22 ` Andrey Konovalov
2018-01-22 18:12 ` Nick Desaulniers
2018-01-23 2:20 ` Andrew Morton
2018-01-23 9:35 ` Andrey Ryabinin [this message]
2018-01-23 15:59 ` Andrey Konovalov
2018-01-23 9:24 ` Andrey Ryabinin
2018-01-23 16:34 ` Andrey Konovalov
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=9e61ea96-e10e-e200-e88d-51fc202c36c9@virtuozzo.com \
--to=aryabinin@virtuozzo.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@google.com \
--cc=arnd@arndb.de \
--cc=dvyukov@google.com \
--cc=eugenis@google.com \
--cc=ghackmann@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kcc@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manojgupta@google.com \
--cc=michal.lkml@markovi.net \
--cc=ndesaulniers@google.com \
--cc=pirama@google.com \
--cc=srhines@google.com \
--cc=yamada.masahiro@socionext.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