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>] [day] [month] [year] [list]
Message-ID: <175757610011.709179.5506163533242194344.tip-bot2@tip-bot2>
Date: Thu, 11 Sep 2025 07:35:00 -0000
From: "tip-bot2 for Kees Cook" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Kees Cook <kees@...nel.org>,
 "Peter Zijlstra (Intel)" <peterz@...radead.org>,
 Nathan Chancellor <nathan@...nel.org>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: x86/core] compiler_types.h: Move __nocfi out of
 compiler-specific header

The following commit has been merged into the x86/core branch of tip:

Commit-ID:     038c7dc66e2744e5df57163b8f957745ae10d23e
Gitweb:        https://git.kernel.org/tip/038c7dc66e2744e5df57163b8f957745ae10d23e
Author:        Kees Cook <kees@...nel.org>
AuthorDate:    Wed, 03 Sep 2025 20:46:40 -07:00
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Thu, 04 Sep 2025 21:59:07 +02:00

compiler_types.h: Move __nocfi out of compiler-specific header

Prepare for GCC KCFI support and move the __nocfi attribute from
compiler-clang.h to compiler_types.h. This was already gated by
CONFIG_CFI_CLANG, so this remains safe for non-KCFI GCC builds.

Signed-off-by: Kees Cook <kees@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Nathan Chancellor <nathan@...nel.org>
Link: https://lore.kernel.org/r/20250904034656.3670313-1-kees@kernel.org
---
 include/linux/compiler-clang.h | 5 -----
 include/linux/compiler_types.h | 4 +++-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index fa4ffe0..7a4568e 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -96,11 +96,6 @@
 # define __noscs	__attribute__((__no_sanitize__("shadow-call-stack")))
 #endif
 
-#if __has_feature(kcfi)
-/* Disable CFI checking inside a function. */
-#define __nocfi		__attribute__((__no_sanitize__("kcfi")))
-#endif
-
 /*
  * Turn individual warnings and errors on and off locally, depending
  * on version.
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 1675543..a910f9f 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -432,7 +432,9 @@ struct ftrace_likely_data {
 # define __noscs
 #endif
 
-#ifndef __nocfi
+#if defined(CONFIG_CFI_CLANG)
+# define __nocfi		__attribute__((__no_sanitize__("kcfi")))
+#else
 # define __nocfi
 #endif
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ