From: Pawan Gupta Date: Wed, 18 Jun 2025 00:46:39 +0000 (-0700) Subject: x86/its: Fix undefined reference to cpu_wants_rethunk_at() X-Git-Tag: v5.10.240~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=07d828c0845651a7822be9535e91c095474bd140;p=thirdparty%2Fkernel%2Fstable.git x86/its: Fix undefined reference to cpu_wants_rethunk_at() Below error was reported in a 32-bit kernel build: static_call.c:(.ref.text+0x46): undefined reference to `cpu_wants_rethunk_at' make[1]: [Makefile:1234: vmlinux] Error This is because the definition of cpu_wants_rethunk_at() depends on CONFIG_STACK_VALIDATION which is only enabled in 64-bit mode. Define the empty function for CONFIG_STACK_VALIDATION=n, rethunk mitigation is anyways not supported without it. Reported-by: Guenter Roeck Fixes: 5d19a0574b75 ("x86/its: Add support for ITS-safe return thunk") Link: https://lore.kernel.org/stable/0f597436-5da6-4319-b918-9f57bde5634a@roeck-us.net/ Signed-off-by: Pawan Gupta Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index d7f33c1e052b7..4b9a2842f90e9 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -80,7 +80,7 @@ extern void apply_returns(s32 *start, s32 *end); struct module; -#ifdef CONFIG_RETHUNK +#if defined(CONFIG_RETHUNK) && defined(CONFIG_STACK_VALIDATION) extern bool cpu_wants_rethunk(void); extern bool cpu_wants_rethunk_at(void *addr); #else