From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id 02DCA8E0095 for ; Tue, 11 Dec 2018 10:28:46 -0500 (EST) Received: by mail-ed1-f69.google.com with SMTP id x15so7134259edd.2 for ; Tue, 11 Dec 2018 07:28:45 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k26sor8182415edd.12.2018.12.11.07.28.44 for (Google Transport Security); Tue, 11 Dec 2018 07:28:44 -0800 (PST) Date: Tue, 11 Dec 2018 16:28:41 +0100 From: Luc Van Oostenryck Subject: Re: [PATCH v13 05/25] kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS Message-ID: <20181211152840.ezjujzpyz5z6fd2d@ltop.local> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Andrey Konovalov Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Will Deacon , Christoph Lameter , Andrew Morton , Mark Rutland , Nick Desaulniers , Marc Zyngier , Dave Martin , Ard Biesheuvel , "Eric W . Biederman" , Ingo Molnar , Paul Lawrence , Geert Uytterhoeven , Arnd Bergmann , "Kirill A . Shutemov" , Greg Kroah-Hartman , Kate Stewart , Mike Rapoport , kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sparse@vger.kernel.org, linux-mm@kvack.org, linux-kbuild@vger.kernel.org, Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Jann Horn , Mark Brand , Chintan Pandya , Vishwath Mohan On Thu, Dec 06, 2018 at 01:24:23PM +0100, Andrey Konovalov wrote: > diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h > index 3e7dafb3ea80..39f668d5066b 100644 > --- a/include/linux/compiler-clang.h > +++ b/include/linux/compiler-clang.h > @@ -16,9 +16,13 @@ > /* all clang versions usable with the kernel support KASAN ABI version 5 */ > #define KASAN_ABI_VERSION 5 > > +#if __has_feature(address_sanitizer) || __has_feature(hwaddress_sanitizer) > /* emulate gcc's __SANITIZE_ADDRESS__ flag */ > -#if __has_feature(address_sanitizer) > #define __SANITIZE_ADDRESS__ > +#define __no_sanitize_address \ > + __attribute__((no_sanitize("address", "hwaddress"))) > +#else > +#define __no_sanitize_address > #endif > > /* > diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h > index 2010493e1040..5776da43da97 100644 > --- a/include/linux/compiler-gcc.h > +++ b/include/linux/compiler-gcc.h > @@ -143,6 +143,12 @@ > #define KASAN_ABI_VERSION 3 > #endif > > +#if __has_attribute(__no_sanitize_address__) > +#define __no_sanitize_address __attribute__((no_sanitize_address)) > +#else > +#define __no_sanitize_address > +#endif Not really important but it's the name with leading and trailing underscores that is tested with __has_attribute() but then it's the naked 'no_sanitize_address' that is used in the attribute. -- Luc