lists.openwall.net   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  linux-cve-announce  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]
Message-ID: <CANiq72=B6XKwfkC9L4=+OxWtjxCp-94TWRG1a=pC=y636gzckA@mail.gmail.com>
Date:   Mon, 28 Oct 2019 18:37:17 +0100
From:   Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To:     Joe Perches <joe@...ches.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        clang-built-linux <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] compiler*.h: Add '__' prefix and suffix to all
 __attribute__ #defines

On Mon, Oct 28, 2019 at 12:43 PM Joe Perches <joe@...ches.com> wrote:
>
> diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
> index 72393a..b8c2145 100644
> --- a/include/linux/compiler_types.h
> +++ b/include/linux/compiler_types.h
> @@ -5,27 +5,27 @@
>  #ifndef __ASSEMBLY__
>
>  #ifdef __CHECKER__
> -# define __user                __attribute__((noderef, address_space(1)))
> -# define __kernel      __attribute__((address_space(0)))
> -# define __safe                __attribute__((safe))
> -# define __force       __attribute__((force))
> -# define __nocast      __attribute__((nocast))
> -# define __iomem       __attribute__((noderef, address_space(2)))
> -# define __must_hold(x)        __attribute__((context(x,1,1)))
> -# define __acquires(x) __attribute__((context(x,0,1)))
> -# define __releases(x) __attribute__((context(x,1,0)))
> -# define __acquire(x)  __context__(x,1)
> -# define __release(x)  __context__(x,-1)
> +# define __user                __attribute__((__noderef__, __address_space__(1)))
> +# define __kernel      __attribute__((__address_space__(0)))
> +# define __safe                __attribute__((__safe__))
> +# define __force       __attribute__((__force__))
> +# define __nocast      __attribute__((__nocast__))
> +# define __iomem       __attribute__((__noderef__, __address_space__(2)))
> +# define __must_hold(x)        __attribute__((__context__(x, 1, 1)))
> +# define __acquires(x) __attribute__((__context__(x, 0, 1)))
> +# define __releases(x) __attribute__((__context__(x, 1, 0)))
> +# define __acquire(x)  __context__(x, 1)
> +# define __release(x)  __context__(x, -1)
>  # define __cond_lock(x,c)      ((c) ? ({ __acquire(x); 1; }) : 0)
> -# define __percpu      __attribute__((noderef, address_space(3)))
> -# define __rcu         __attribute__((noderef, address_space(4)))
> -# define __private     __attribute__((noderef))
> +# define __percpu      __attribute__((__noderef__, __address_space__(3)))
> +# define __rcu         __attribute__((__noderef__, __address_space__(4)))
> +# define __private     __attribute__((__noderef__))

Just in case: for these ones (i.e. __CHECKER__), did you check if
sparse handles this syntax? (I don't recall myself if it does).

Other than that, thanks for the cleanup too! I can pick it up in the
the compiler-attributes tree and put it in -next.

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ