From: Andrey Konovalov <andreyknvl@google.com>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
kasan-dev <kasan-dev@googlegroups.com>,
Linux Memory Management List <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Kostya Serebryany <kcc@google.com>,
Evgeniy Stepanov <eugenis@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] kasan: add __asan_report_loadN/storeN_noabort callbacks
Date: Tue, 23 Jan 2018 16:34:23 +0100 [thread overview]
Message-ID: <CAAeHK+xCHOm1=FKwxvzgYak+HsDkGSkN7ZGxHw-zSNa_R6RqZQ@mail.gmail.com> (raw)
In-Reply-To: <b2faf615-b1cd-b3ec-502f-38fef11182a2@virtuozzo.com>
On Tue, Jan 23, 2018 at 11:44 AM, Andrey Ryabinin
<aryabinin@virtuozzo.com> wrote:
> On 01/19/2018 08:44 PM, Andrey Konovalov wrote:
>> Instead of __asan_report_load_n_noabort and __asan_report_store_n_noabort
>> callbacks Clang emits differently named __asan_report_loadN_noabort and
>> __asan_report_storeN_noabort (similar to __asan_loadN/storeN_noabort, whose
>> names both GCC and Clang agree on).
>>
>> Add callback implementation for __asan_report_loadN/storeN_noabort.
>>
>
> This made me wonder why this wasn't observed before. So I noticed that
> inline instrumentation with -fsanitize=kernel-addresss is broken in clang,
> and clang never calls __asan_report*() functions. I see that you guys fixed this
> just yesterday https://reviews.llvm.org/D42384 .
Correct.
>
> But it seems that you didn't fix the rest of "if (CompileKernel)" crap.
> Clang generates "__asan_report_[load,store]N*" instead of "__asan_report_[load,store]_n*"
> only because of this idiocy:
>
> const std::string SuffixStr = CompileKernel ? "N" : "_n";
>
> See https://github.com/llvm-mirror/llvm/blob/ca19eaabd75f55865efd321b7a6f1d4ba3db8bc8/lib/Transforms/Instrumentation/AddressSanitizer.cpp#L2250
>
> Note that SuffixStr is used *only* for __asan_report_* callbacks, which makes no sense because
> we never ever had __asan_report* callbacks with "N" suffix.
>
> So I think that you should just fix the llvm here.
I think you are right.
I thought that GCC uses different and inconsistent callback names for
the kernel and user space, but that doesn't seem to be the case.
I submitted an LLVM change: https://reviews.llvm.org/D42423
Please discard this patch.
>
> And there is probably one more "if (CompileKernel)" crap in runOnModule()
> which breaks globals instrumentation.
Right, this will be fixed at some point.
>
>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2018-01-23 15:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 17:44 Andrey Konovalov
2018-01-23 10:44 ` Andrey Ryabinin
2018-01-23 15:34 ` Andrey Konovalov [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='CAAeHK+xCHOm1=FKwxvzgYak+HsDkGSkN7ZGxHw-zSNa_R6RqZQ@mail.gmail.com' \
--to=andreyknvl@google.com \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=dvyukov@google.com \
--cc=eugenis@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kcc@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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