linux/arch/x86/entry
Andrew Cooper e58f1a9b06 x86/fred: Correct speculative safety in fred_extint()
[ Upstream commit aa280a08e7 ]

array_index_nospec() is no use if the result gets spilled to the stack, as
it makes the believed safe-under-speculation value subject to memory
predictions.

For all practical purposes, this means array_index_nospec() must be used in
the expression that accesses the array.

As the code currently stands, it's the wrong side of irqentry_enter(), and
'index' is put into %ebp across the function call.

Remove the index variable and reposition array_index_nospec(), so it's
calculated immediately before the array access.

Fixes: 14619d912b ("x86/fred: FRED entry/exit and dispatch code")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260106131504.679932-1-andrew.cooper3@citrix.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-12 07:09:11 -04:00
..
syscalls uprobes/x86: Add uprobe syscall to speed up uprobe 2025-08-21 20:09:20 +02:00
vdso stackleak: Split KSTACK_ERASE_CFLAGS from GCC_PLUGINS_CFLAGS 2025-07-21 21:40:57 -07:00
vsyscall x86/vsyscall: Do not require X86_PF_INSTR to emulate vsyscall 2025-08-13 15:02:12 -07:00
calling.h x86/fred: Play nice with invoking asm_fred_entry_from_kvm() on non-FRED hardware 2025-08-18 14:23:08 +02:00
entry.S x86/bugs: Rename MDS machinery to something more generic 2025-06-16 18:45:18 +02:00
entry_32.S x86/percpu: Move top_of_stack to percpu hot section 2025-03-04 20:30:33 +01:00
entry_64.S x86/its: Align RETs in BHB clear sequence to avoid thunking 2025-05-09 13:22:05 -07:00
entry_64_compat.S x86/percpu: Move top_of_stack to percpu hot section 2025-03-04 20:30:33 +01:00
entry_64_fred.S - Remove a bunch of asm implementing condition flags testing in KVM's 2025-10-11 11:19:16 -07:00
entry_fred.c x86/fred: Correct speculative safety in fred_extint() 2026-03-12 07:09:11 -04:00
Makefile x86/syscall: Move sys_ni_syscall() 2025-03-19 11:19:17 +01:00
syscall_32.c x86/syscall/32: Add comment to conditional 2025-03-19 11:19:20 +01:00
syscall_64.c x86/syscall: Remove stray semicolons 2025-03-19 11:19:18 +01:00
thunk.S x86/entry: Merge thunk_64.S and thunk_32.S into thunk.S 2024-04-09 09:57:56 +02:00