linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize`
@ 2022-10-21 11:59 Miguel Ojeda
  2022-10-21 11:59 ` [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__` Miguel Ojeda
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Miguel Ojeda @ 2022-10-21 11:59 UTC (permalink / raw)
  To: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann
  Cc: Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Nathan Chancellor, Uros Bizjak, Dan Li, Alexander Potapenko,
	Miguel Ojeda, linux-kernel

Other macros that define shorthands for attributes in e.g.
`compiler_attributes.h` and elsewhere use underscores.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler-gcc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index f55a37efdb97..b9530d3515ac 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -83,25 +83,25 @@
 #endif
 
 #if __has_attribute(__no_sanitize_address__)
-#define __no_sanitize_address __attribute__((no_sanitize_address))
+#define __no_sanitize_address __attribute__((__no_sanitize_address__))
 #else
 #define __no_sanitize_address
 #endif
 
 #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
-#define __no_sanitize_thread __attribute__((no_sanitize_thread))
+#define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
 #else
 #define __no_sanitize_thread
 #endif
 
 #if __has_attribute(__no_sanitize_undefined__)
-#define __no_sanitize_undefined __attribute__((no_sanitize_undefined))
+#define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
 #else
 #define __no_sanitize_undefined
 #endif
 
 #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
-#define __no_sanitize_coverage __attribute__((no_sanitize_coverage))
+#define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
 #else
 #define __no_sanitize_coverage
 #endif

base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__`
  2022-10-21 11:59 [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Miguel Ojeda
@ 2022-10-21 11:59 ` Miguel Ojeda
  2022-10-21 16:11   ` Kees Cook
  2022-10-21 21:18   ` Nathan Chancellor
  2022-10-21 11:59 ` [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__` Miguel Ojeda
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 17+ messages in thread
From: Miguel Ojeda @ 2022-10-21 11:59 UTC (permalink / raw)
  To: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann
  Cc: Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Nathan Chancellor, Uros Bizjak, Dan Li, Alexander Potapenko,
	Miguel Ojeda, linux-kernel

The attribute was added in GCC 4.8, while the minimum GCC version
supported by the kernel is GCC 5.1.

Therefore, remove the check.

Link: https://godbolt.org/z/84v56vcn8
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler-gcc.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index b9530d3515ac..bfce7f4d0978 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -82,11 +82,7 @@
 #define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
 #endif
 
-#if __has_attribute(__no_sanitize_address__)
 #define __no_sanitize_address __attribute__((__no_sanitize_address__))
-#else
-#define __no_sanitize_address
-#endif
 
 #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
 #define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__`
  2022-10-21 11:59 [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Miguel Ojeda
  2022-10-21 11:59 ` [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__` Miguel Ojeda
@ 2022-10-21 11:59 ` Miguel Ojeda
  2022-10-21 14:55   ` Marco Elver
                     ` (2 more replies)
  2022-10-21 11:59 ` [PATCH 4/5] compiler-gcc: remove attribute support check for `__no_sanitize_undefined__` Miguel Ojeda
                   ` (3 subsequent siblings)
  5 siblings, 3 replies; 17+ messages in thread
From: Miguel Ojeda @ 2022-10-21 11:59 UTC (permalink / raw)
  To: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann
  Cc: Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Nathan Chancellor, Uros Bizjak, Dan Li, Alexander Potapenko,
	Miguel Ojeda, linux-kernel

The attribute was added in GCC 5.1, which matches the minimum GCC version
supported by the kernel.

Therefore, remove the check.

Link: https://godbolt.org/z/vbxKejxbx
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler-gcc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index bfce7f4d0978..ba207deb77ca 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -84,7 +84,7 @@
 
 #define __no_sanitize_address __attribute__((__no_sanitize_address__))
 
-#if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
+#if defined(__SANITIZE_THREAD__)
 #define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
 #else
 #define __no_sanitize_thread
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 4/5] compiler-gcc: remove attribute support check for `__no_sanitize_undefined__`
  2022-10-21 11:59 [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Miguel Ojeda
  2022-10-21 11:59 ` [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__` Miguel Ojeda
  2022-10-21 11:59 ` [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__` Miguel Ojeda
@ 2022-10-21 11:59 ` Miguel Ojeda
  2022-10-21 16:11   ` Kees Cook
  2022-10-21 21:19   ` Nathan Chancellor
  2022-10-21 11:59 ` [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__` Miguel Ojeda
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 17+ messages in thread
From: Miguel Ojeda @ 2022-10-21 11:59 UTC (permalink / raw)
  To: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann
  Cc: Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Nathan Chancellor, Uros Bizjak, Dan Li, Alexander Potapenko,
	Miguel Ojeda, linux-kernel

The attribute was added in GCC 4.9, while the minimum GCC version
supported by the kernel is GCC 5.1.

Therefore, remove the check.

Link: https://godbolt.org/z/GrMeo6fYr
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler-gcc.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index ba207deb77ca..7f2c2bb73815 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -90,11 +90,7 @@
 #define __no_sanitize_thread
 #endif
 
-#if __has_attribute(__no_sanitize_undefined__)
 #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
-#else
-#define __no_sanitize_undefined
-#endif
 
 #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
 #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__`
  2022-10-21 11:59 [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Miguel Ojeda
                   ` (2 preceding siblings ...)
  2022-10-21 11:59 ` [PATCH 4/5] compiler-gcc: remove attribute support check for `__no_sanitize_undefined__` Miguel Ojeda
@ 2022-10-21 11:59 ` Miguel Ojeda
  2022-10-21 14:55   ` Marco Elver
                     ` (2 more replies)
  2022-10-21 16:11 ` [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Kees Cook
  2022-10-21 21:17 ` Nathan Chancellor
  5 siblings, 3 replies; 17+ messages in thread
From: Miguel Ojeda @ 2022-10-21 11:59 UTC (permalink / raw)
  To: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann
  Cc: Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Nathan Chancellor, Uros Bizjak, Dan Li, Alexander Potapenko,
	Miguel Ojeda, linux-kernel

The attribute was added in GCC 12.1.

This will simplify future cleanups, and is closer to what we do
in `compiler_attributes.h`.

Link: https://godbolt.org/z/MGbT76j6G
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler-gcc.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 7f2c2bb73815..7af9e34ec261 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -92,6 +92,9 @@
 
 #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
 
+/*
+ * Only supported since gcc >= 12
+ */
 #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
 #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
 #else
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__`
  2022-10-21 11:59 ` [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__` Miguel Ojeda
@ 2022-10-21 14:55   ` Marco Elver
  2022-10-21 16:11   ` Kees Cook
  2022-10-21 21:20   ` Nathan Chancellor
  2 siblings, 0 replies; 17+ messages in thread
From: Marco Elver @ 2022-10-21 14:55 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Kees Cook, Arnd Bergmann, Andrew Morton,
	Kumar Kartikeya Dwivedi, Nick Desaulniers, Nathan Chancellor,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, 21 Oct 2022 at 05:00, Miguel Ojeda <ojeda@kernel.org> wrote:
>
> The attribute was added in GCC 12.1.
>
> This will simplify future cleanups, and is closer to what we do
> in `compiler_attributes.h`.
>
> Link: https://godbolt.org/z/MGbT76j6G
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Acked-by: Marco Elver <elver@google.com>

> ---
>  include/linux/compiler-gcc.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index 7f2c2bb73815..7af9e34ec261 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -92,6 +92,9 @@
>
>  #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
>
> +/*
> + * Only supported since gcc >= 12
> + */
>  #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
>  #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
>  #else
> --
> 2.38.1
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__`
  2022-10-21 11:59 ` [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__` Miguel Ojeda
@ 2022-10-21 14:55   ` Marco Elver
  2022-10-21 16:11   ` Kees Cook
  2022-10-21 21:18   ` Nathan Chancellor
  2 siblings, 0 replies; 17+ messages in thread
From: Marco Elver @ 2022-10-21 14:55 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Kees Cook, Arnd Bergmann, Andrew Morton,
	Kumar Kartikeya Dwivedi, Nick Desaulniers, Nathan Chancellor,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, 21 Oct 2022 at 05:00, Miguel Ojeda <ojeda@kernel.org> wrote:
>
> The attribute was added in GCC 5.1, which matches the minimum GCC version
> supported by the kernel.
>
> Therefore, remove the check.
>
> Link: https://godbolt.org/z/vbxKejxbx
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Acked-by: Marco Elver <elver@google.com>

> ---
>  include/linux/compiler-gcc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index bfce7f4d0978..ba207deb77ca 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -84,7 +84,7 @@
>
>  #define __no_sanitize_address __attribute__((__no_sanitize_address__))
>
> -#if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
> +#if defined(__SANITIZE_THREAD__)
>  #define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
>  #else
>  #define __no_sanitize_thread
> --
> 2.38.1
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize`
  2022-10-21 11:59 [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Miguel Ojeda
                   ` (3 preceding siblings ...)
  2022-10-21 11:59 ` [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__` Miguel Ojeda
@ 2022-10-21 16:11 ` Kees Cook
  2022-10-21 21:17 ` Nathan Chancellor
  5 siblings, 0 replies; 17+ messages in thread
From: Kees Cook @ 2022-10-21 16:11 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Arnd Bergmann, Andrew Morton,
	Kumar Kartikeya Dwivedi, Nick Desaulniers, Nathan Chancellor,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:52PM +0200, Miguel Ojeda wrote:
> Other macros that define shorthands for attributes in e.g.
> `compiler_attributes.h` and elsewhere use underscores.
> 
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__`
  2022-10-21 11:59 ` [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__` Miguel Ojeda
@ 2022-10-21 16:11   ` Kees Cook
  2022-10-21 21:18   ` Nathan Chancellor
  1 sibling, 0 replies; 17+ messages in thread
From: Kees Cook @ 2022-10-21 16:11 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Arnd Bergmann, Andrew Morton,
	Kumar Kartikeya Dwivedi, Nick Desaulniers, Nathan Chancellor,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:53PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 4.8, while the minimum GCC version
> supported by the kernel is GCC 5.1.
> 
> Therefore, remove the check.
> 
> Link: https://godbolt.org/z/84v56vcn8
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__`
  2022-10-21 11:59 ` [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__` Miguel Ojeda
  2022-10-21 14:55   ` Marco Elver
@ 2022-10-21 16:11   ` Kees Cook
  2022-10-21 21:18   ` Nathan Chancellor
  2 siblings, 0 replies; 17+ messages in thread
From: Kees Cook @ 2022-10-21 16:11 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Arnd Bergmann, Andrew Morton,
	Kumar Kartikeya Dwivedi, Nick Desaulniers, Nathan Chancellor,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:54PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 5.1, which matches the minimum GCC version
> supported by the kernel.
> 
> Therefore, remove the check.
> 
> Link: https://godbolt.org/z/vbxKejxbx
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 4/5] compiler-gcc: remove attribute support check for `__no_sanitize_undefined__`
  2022-10-21 11:59 ` [PATCH 4/5] compiler-gcc: remove attribute support check for `__no_sanitize_undefined__` Miguel Ojeda
@ 2022-10-21 16:11   ` Kees Cook
  2022-10-21 21:19   ` Nathan Chancellor
  1 sibling, 0 replies; 17+ messages in thread
From: Kees Cook @ 2022-10-21 16:11 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Arnd Bergmann, Andrew Morton,
	Kumar Kartikeya Dwivedi, Nick Desaulniers, Nathan Chancellor,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:55PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 4.9, while the minimum GCC version
> supported by the kernel is GCC 5.1.
> 
> Therefore, remove the check.
> 
> Link: https://godbolt.org/z/GrMeo6fYr
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__`
  2022-10-21 11:59 ` [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__` Miguel Ojeda
  2022-10-21 14:55   ` Marco Elver
@ 2022-10-21 16:11   ` Kees Cook
  2022-10-21 21:20   ` Nathan Chancellor
  2 siblings, 0 replies; 17+ messages in thread
From: Kees Cook @ 2022-10-21 16:11 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Arnd Bergmann, Andrew Morton,
	Kumar Kartikeya Dwivedi, Nick Desaulniers, Nathan Chancellor,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:56PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 12.1.
> 
> This will simplify future cleanups, and is closer to what we do
> in `compiler_attributes.h`.
> 
> Link: https://godbolt.org/z/MGbT76j6G
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize`
  2022-10-21 11:59 [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Miguel Ojeda
                   ` (4 preceding siblings ...)
  2022-10-21 16:11 ` [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Kees Cook
@ 2022-10-21 21:17 ` Nathan Chancellor
  5 siblings, 0 replies; 17+ messages in thread
From: Nathan Chancellor @ 2022-10-21 21:17 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann,
	Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:52PM +0200, Miguel Ojeda wrote:
> Other macros that define shorthands for attributes in e.g.
> `compiler_attributes.h` and elsewhere use underscores.
> 
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  include/linux/compiler-gcc.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index f55a37efdb97..b9530d3515ac 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -83,25 +83,25 @@
>  #endif
>  
>  #if __has_attribute(__no_sanitize_address__)
> -#define __no_sanitize_address __attribute__((no_sanitize_address))
> +#define __no_sanitize_address __attribute__((__no_sanitize_address__))
>  #else
>  #define __no_sanitize_address
>  #endif
>  
>  #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
> -#define __no_sanitize_thread __attribute__((no_sanitize_thread))
> +#define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
>  #else
>  #define __no_sanitize_thread
>  #endif
>  
>  #if __has_attribute(__no_sanitize_undefined__)
> -#define __no_sanitize_undefined __attribute__((no_sanitize_undefined))
> +#define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
>  #else
>  #define __no_sanitize_undefined
>  #endif
>  
>  #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
> -#define __no_sanitize_coverage __attribute__((no_sanitize_coverage))
> +#define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
>  #else
>  #define __no_sanitize_coverage
>  #endif
> 
> base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780
> -- 
> 2.38.1
> 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__`
  2022-10-21 11:59 ` [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__` Miguel Ojeda
  2022-10-21 16:11   ` Kees Cook
@ 2022-10-21 21:18   ` Nathan Chancellor
  1 sibling, 0 replies; 17+ messages in thread
From: Nathan Chancellor @ 2022-10-21 21:18 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann,
	Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:53PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 4.8, while the minimum GCC version
> supported by the kernel is GCC 5.1.
> 
> Therefore, remove the check.
> 
> Link: https://godbolt.org/z/84v56vcn8
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  include/linux/compiler-gcc.h | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index b9530d3515ac..bfce7f4d0978 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -82,11 +82,7 @@
>  #define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
>  #endif
>  
> -#if __has_attribute(__no_sanitize_address__)
>  #define __no_sanitize_address __attribute__((__no_sanitize_address__))
> -#else
> -#define __no_sanitize_address
> -#endif
>  
>  #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
>  #define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
> -- 
> 2.38.1
> 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__`
  2022-10-21 11:59 ` [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__` Miguel Ojeda
  2022-10-21 14:55   ` Marco Elver
  2022-10-21 16:11   ` Kees Cook
@ 2022-10-21 21:18   ` Nathan Chancellor
  2 siblings, 0 replies; 17+ messages in thread
From: Nathan Chancellor @ 2022-10-21 21:18 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann,
	Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:54PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 5.1, which matches the minimum GCC version
> supported by the kernel.
> 
> Therefore, remove the check.
> 
> Link: https://godbolt.org/z/vbxKejxbx
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  include/linux/compiler-gcc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index bfce7f4d0978..ba207deb77ca 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -84,7 +84,7 @@
>  
>  #define __no_sanitize_address __attribute__((__no_sanitize_address__))
>  
> -#if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__)
> +#if defined(__SANITIZE_THREAD__)
>  #define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
>  #else
>  #define __no_sanitize_thread
> -- 
> 2.38.1
> 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 4/5] compiler-gcc: remove attribute support check for `__no_sanitize_undefined__`
  2022-10-21 11:59 ` [PATCH 4/5] compiler-gcc: remove attribute support check for `__no_sanitize_undefined__` Miguel Ojeda
  2022-10-21 16:11   ` Kees Cook
@ 2022-10-21 21:19   ` Nathan Chancellor
  1 sibling, 0 replies; 17+ messages in thread
From: Nathan Chancellor @ 2022-10-21 21:19 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann,
	Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:55PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 4.9, while the minimum GCC version
> supported by the kernel is GCC 5.1.
> 
> Therefore, remove the check.
> 
> Link: https://godbolt.org/z/GrMeo6fYr
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  include/linux/compiler-gcc.h | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index ba207deb77ca..7f2c2bb73815 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -90,11 +90,7 @@
>  #define __no_sanitize_thread
>  #endif
>  
> -#if __has_attribute(__no_sanitize_undefined__)
>  #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
> -#else
> -#define __no_sanitize_undefined
> -#endif
>  
>  #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
>  #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
> -- 
> 2.38.1
> 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__`
  2022-10-21 11:59 ` [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__` Miguel Ojeda
  2022-10-21 14:55   ` Marco Elver
  2022-10-21 16:11   ` Kees Cook
@ 2022-10-21 21:20   ` Nathan Chancellor
  2 siblings, 0 replies; 17+ messages in thread
From: Nathan Chancellor @ 2022-10-21 21:20 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Andrey Konovalov, Marco Elver, Kees Cook, Arnd Bergmann,
	Andrew Morton, Kumar Kartikeya Dwivedi, Nick Desaulniers,
	Uros Bizjak, Dan Li, Alexander Potapenko, linux-kernel

On Fri, Oct 21, 2022 at 01:59:56PM +0200, Miguel Ojeda wrote:
> The attribute was added in GCC 12.1.
> 
> This will simplify future cleanups, and is closer to what we do
> in `compiler_attributes.h`.
> 
> Link: https://godbolt.org/z/MGbT76j6G
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  include/linux/compiler-gcc.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index 7f2c2bb73815..7af9e34ec261 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -92,6 +92,9 @@
>  
>  #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__))
>  
> +/*
> + * Only supported since gcc >= 12
> + */
>  #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
>  #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__))
>  #else
> -- 
> 2.38.1
> 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-10-21 21:21 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21 11:59 [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Miguel Ojeda
2022-10-21 11:59 ` [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__` Miguel Ojeda
2022-10-21 16:11   ` Kees Cook
2022-10-21 21:18   ` Nathan Chancellor
2022-10-21 11:59 ` [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__` Miguel Ojeda
2022-10-21 14:55   ` Marco Elver
2022-10-21 16:11   ` Kees Cook
2022-10-21 21:18   ` Nathan Chancellor
2022-10-21 11:59 ` [PATCH 4/5] compiler-gcc: remove attribute support check for `__no_sanitize_undefined__` Miguel Ojeda
2022-10-21 16:11   ` Kees Cook
2022-10-21 21:19   ` Nathan Chancellor
2022-10-21 11:59 ` [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__` Miguel Ojeda
2022-10-21 14:55   ` Marco Elver
2022-10-21 16:11   ` Kees Cook
2022-10-21 21:20   ` Nathan Chancellor
2022-10-21 16:11 ` [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Kees Cook
2022-10-21 21:17 ` Nathan Chancellor

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).