From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by kanga.kvack.org (Postfix) with ESMTP id A149C8E0095 for ; Tue, 11 Dec 2018 11:02:55 -0500 (EST) Received: by mail-io1-f71.google.com with SMTP id m5so14462047iok.22 for ; Tue, 11 Dec 2018 08:02:55 -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 d142sor4104728itc.16.2018.12.11.08.02.54 for (Google Transport Security); Tue, 11 Dec 2018 08:02:54 -0800 (PST) MIME-Version: 1.0 References: <20181211152840.ezjujzpyz5z6fd2d@ltop.local> In-Reply-To: <20181211152840.ezjujzpyz5z6fd2d@ltop.local> From: Andrey Konovalov Date: Tue, 11 Dec 2018 17:02:42 +0100 Message-ID: Subject: Re: [PATCH v13 05/25] kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Luc Van Oostenryck 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 , "open list:DOCUMENTATION" , LKML , Linux ARM , linux-sparse@vger.kernel.org, Linux Memory Management List , Linux Kbuild mailing list , Kostya Serebryany , Evgenii Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Jann Horn , Mark Brand , Chintan Pandya , Vishwath Mohan On Tue, Dec 11, 2018 at 4:28 PM Luc Van Oostenryck wrote: > > 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. Hi Luc, You're right. This shouldn't be important though, since "__" in attribute names are optional AFAIK. It might make sense to fix it as a separate patch when this series is merged. Thanks!