mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +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@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20250904034656.3670313-1-kees@kernel.org
This commit is contained in:
parent
894af4a1cd
commit
038c7dc66e
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user