linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Andrey Konovalov <andreyknvl@google.com>
Cc: Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Will Deacon <will.deacon@arm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Paul Lawrence <paullawrence@google.com>,
	Sandipan Das <sandipan@linux.vnet.ibm.com>,
	Kees Cook <keescook@chromium.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Kostya Serebryany <kcc@google.com>
Subject: Re: [PATCH] kasan: add no_sanitize attribute for clang builds
Date: Fri, 13 Apr 2018 22:16:30 +0300	[thread overview]
Message-ID: <c95bd92f-bef4-378a-55ed-04439c784e43@virtuozzo.com> (raw)
In-Reply-To: <CAAeHK+y18zU_PAS5KB82PNqtvGNex+S0Jk3bWaE19=YjThaNow@mail.gmail.com>



On 04/13/2018 08:34 PM, Andrey Konovalov wrote:
> On Fri, Apr 13, 2018 at 5:31 PM, Andrey Ryabinin
> <aryabinin@virtuozzo.com> wrote:
>>
>>
>> On 04/12/2018 08:29 PM, Andrey Konovalov wrote:
>>> KASAN uses the __no_sanitize_address macro to disable instrumentation
>>> of particular functions. Right now it's defined only for GCC build,
>>> which causes false positives when clang is used.
>>>
>>> This patch adds a definition for clang.
>>>
>>> Note, that clang's revision 329612 or higher is required.
>>>
>>> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
>>> ---
>>>  include/linux/compiler-clang.h | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
>>> index ceb96ecab96e..5a1d8580febe 100644
>>> --- a/include/linux/compiler-clang.h
>>> +++ b/include/linux/compiler-clang.h
>>> @@ -25,6 +25,11 @@
>>>  #define __SANITIZE_ADDRESS__
>>>  #endif
>>>
>>> +#ifdef CONFIG_KASAN
>>
>> If, for whatever reason, developer decides to add __no_sanitize_address to some
>> generic function, guess what will happen next when he/she will try to build CONFIG_KASAN=n kernel?
> 
> It's defined to nothing in compiler-gcc.h and redefined in
> compiler-clang.h only if CONFIG_KASAN is enabled, so everything should
> be fine. Am I missing something?

No, It's was me missing something ;)
However, "#ifdef CONFIG_KASAN" seems to be redundant, I'd rather remove it.

Anyway:
	Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>

  reply	other threads:[~2018-04-13 19:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12 17:29 [PATCH] kasan: add no_sanitize attribute for clang builds Andrey Konovalov
2018-04-13 15:31 ` Andrey Ryabinin
2018-04-13 17:34   ` Andrey Konovalov
2018-04-13 19:16     ` Andrey Ryabinin [this message]
2018-04-17 12:27       ` 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=c95bd92f-bef4-378a-55ed-04439c784e43@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=dvyukov@google.com \
    --cc=dwmw@amazon.co.uk \
    --cc=glider@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kasan-dev@googlegroups.com \
    --cc=kcc@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@kernel.org \
    --cc=paullawrence@google.com \
    --cc=rientjes@google.com \
    --cc=sandipan@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.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;
as well as URLs for NNTP newsgroup(s).