Due to a likely merge resolution error of backport commit 772934d9062a ("x86/its: FineIBT-paranoid vs ITS"), the function its_static_thunk() was placed in the wrong ifdef block, causing a build error when CONFIG_MITIGATION_ITS and CONFIG_FINEIBT are both disabled:
/linux-6.6/arch/x86/kernel/alternative.c:1452:5: error: redefinition of 'its_static_thunk' 1452 | u8 *its_static_thunk(int reg) | ^~~~~~~~~~~~~~~~
Fix it by moving its_static_thunk() under CONFIG_MITIGATION_ITS.
Reported-by: Natanael Copa ncopa@alpinelinux.org Link: https://lore.kernel.org/all/20250519164717.18738b4e@ncopa-desktop/ Signed-off-by: Pawan Gupta pawan.kumar.gupta@linux.intel.com --- commit ("x86/its: FineIBT-paranoid vs ITS") was resolved correctly in v6.12:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v...
Fix is required in v6.6 and v6.1
v5.15 is unaffected:
https://lore.kernel.org/stable/20250516-its-5-15-v3-16-16fcdaaea544@linux.in... --- arch/x86/kernel/alternative.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 4817e424d6965875b7e56ed9aeee5cd6ba8ed5b0..8e6cad42b296ee08aa16df2598ba7196f70b609c 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -730,7 +730,15 @@ static bool cpu_wants_indirect_its_thunk_at(unsigned long addr, int reg) /* Lower-half of the cacheline? */ return !(addr & 0x20); } -#endif + +u8 *its_static_thunk(int reg) +{ + u8 *thunk = __x86_indirect_its_thunk_array[reg]; + + return thunk; +} + +#endif /* CONFIG_MITIGATION_ITS */
/* * Rewrite the compiler generated retpoline thunk calls. @@ -1449,13 +1457,6 @@ static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline, static void poison_cfi(void *addr) { } #endif
-u8 *its_static_thunk(int reg) -{ - u8 *thunk = __x86_indirect_its_thunk_array[reg]; - - return thunk; -} - #endif
void apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
--- base-commit: 615b9e10e3377467ced8f50592a1b5ba8ce053d8 change-id: 20250519-its-build-fix-6-6-b83c6964cc3e
Best regards,