[tip: x86/cleanups] x86/cfi: Use symmetric SYM_START and SYM_END in __CFI_TYPE()

From: tip-bot2 for Jens Remus

Date: Sun Jun 28 2026 - 19:14:26 EST


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

Commit-ID: 0cfdf974f133e0ff17ed80e7895adbe7889d9522
Gitweb: https://git.kernel.org/tip/0cfdf974f133e0ff17ed80e7895adbe7889d9522
Author: Jens Remus <jremus@xxxxxxxxxxxxx>
AuthorDate: Thu, 11 Jun 2026 17:57:15 +02:00
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Sun, 28 Jun 2026 15:22:26 -07:00

x86/cfi: Use symmetric SYM_START and SYM_END in __CFI_TYPE()

Commit

ccace936eec7 ("x86: Add types to indirectly called assembly functions")

introduced a x86-specific implementation of __CFI_TYPE() using an asymmetric
combination of SYM_START() and SYM_FUNC_END() to add a symbol to the KCFI type
identifier that precedes a function.

This asymmetric combination is an issue if SYM_FUNC_END() ever gets extended
in a way that requires it to be used symmetrically with SYM_FUNC_START*().
For instance to emit DWARF CFI directives that denote the start/end of
a function. [1]

Use SYM_END() with SYM_T_FUNC instead. No functional change, as the generic
implementation of SYM_FUNC_END(name) expands into SYM_END(name, SYM_T_FUNC).

Fixes: ccace936eec7 ("x86: Add types to indirectly called assembly functions")
Closes: https://sashiko.dev/#/patchset/20260522110427.2816637-1-jremus@xxxxxxxxxxxxx?part=3 [1]
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Signed-off-by: Jens Remus <jremus@xxxxxxxxxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>
Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Link: https://patch.msgid.link/20260611155716.830563-1-jremus@xxxxxxxxxxxxx
---
arch/x86/include/asm/linkage.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h
index a729465..c9769a7 100644
--- a/arch/x86/include/asm/linkage.h
+++ b/arch/x86/include/asm/linkage.h
@@ -103,7 +103,7 @@
.byte 0xb8 ASM_NL \
.long __kcfi_typeid_##name ASM_NL \
CFI_POST_PADDING \
- SYM_FUNC_END(__cfi_##name)
+ SYM_END(__cfi_##name, SYM_T_FUNC)

/* UML needs to be able to override memcpy() and friends for KASAN. */
#ifdef CONFIG_UML