Skip to content

Commit 535d0ae

Browse files
author
Ingo Molnar
committed
x86/cfi: Only define poison_cfi() if CONFIG_X86_KERNEL_IBT=y
poison_cfi() was introduced in: 9831c62 ("x86/cfi: Extend ENDBR sealing to kCFI") ... but it's only ever used under CONFIG_X86_KERNEL_IBT=y, and if that option is disabled, we get: arch/x86/kernel/alternative.c:1243:13: error: ‘poison_cfi’ defined but not used [-Werror=unused-function] Guard the definition with CONFIG_X86_KERNEL_IBT. Cc: Peter Zijlstra (Intel) <[email protected]> Cc: Kees Cook <[email protected]> Cc: Sami Tolvanen <[email protected]> Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 04505bb commit 535d0ae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/kernel/alternative.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,9 @@ static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
12401240
{
12411241
}
12421242

1243+
#ifdef CONFIG_X86_KERNEL_IBT
12431244
static void poison_cfi(void *addr) { }
1245+
#endif
12441246

12451247
#endif
12461248

0 commit comments

Comments
 (0)