lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 1 Sep 2018 00:10:04 +0200
From:   Miguel Ojeda <>
To:     Rasmus Villemoes <>
Cc:     Linus Torvalds <>,
        linux-kernel <>,
        Eli Friedman <>,
        Christopher Li <>,
        Kees Cook <>,
        Ingo Molnar <>,
        Geert Uytterhoeven <>,
        Arnd Bergmann <>,
        Greg Kroah-Hartman <>,
        Masahiro Yamada <>,
        Joe Perches <>,
        Dominique Martinet <>,
        Nick Desaulniers <>
Subject: Re: [PATCH 2/7] Compiler Attributes: use the no-underscores syntax

Hi Ramus,

On Fri, Aug 31, 2018 at 11:49 PM, Rasmus Villemoes
<> wrote:
> On 2018-08-31 19:05, Miguel Ojeda wrote:
>> The attribute syntax optionally allows to surround attribute names
>> with "__" in order to avoid collisions with macros of the same name
>> (see
>> This homogenizes all attributes to use the syntax without underscores.
> At the risk of bikeshedding, why not the other way around, exactly
> because of what you write above? We have convenience macros anyway, so
> those verbose leading/trailing underscores would only be in compiler*.h,
> and some of the attribute names are common words that can appear as
> #defines. E.g. error is defined
> drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c ; if that used a
> BUILD_BUG_ON somewhere, the
> #define __compiletime_error(message) __attribute__((error(message)))
> would break.

Indeed, if we are afraid of such cases, we should go with the __name__
syntax. I was trying to go first for the "cleanest"/simplest way
first, considering no one should be defining many such macros as
"error" (and in lower case, at that). But indeed, good catch!

Grepping for those in compiler_attributes.h (which, as you point out,
are not all of them) yields:

arch/parisc/boot/compressed/misc.c:#define malloc       malloc_gzip
include/linux/decompress/mm.h:#define malloc(a) kmalloc(a, GFP_KERNEL)
lib/inflate.c:#define malloc(a) kmalloc(a, GFP_KERNEL)
include/linux/compiler_types.h:#define noinline_for_stack noinline
include/linux/raid/pq.h:#define noinline __attribute__((noinline))
tools/include/linux/compiler.h:#define noinline
arch/mips/sgi-ip27/ip27-reset.c:#define noreturn while(1);
                 /* Silence gcc.  */


Powered by blists - more mailing lists