Skip to content

Commit 5681981

Browse files
joergroedelsuryasaimadhu
authored andcommitted
x86/sev: Fix stack type check in vc_switch_off_ist()
The value of STACK_TYPE_EXCEPTION_LAST points to the last _valid_ exception stack. Reflect that in the check done in the vc_switch_off_ist() function. Fixes: a13644f ("x86/entry/64: Add entry code for #VC handler") Reported-by: Tom Lendacky <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent e7d445a commit 5681981

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *r
709709
stack = (unsigned long *)sp;
710710

711711
if (!get_stack_info_noinstr(stack, current, &info) || info.type == STACK_TYPE_ENTRY ||
712-
info.type >= STACK_TYPE_EXCEPTION_LAST)
712+
info.type > STACK_TYPE_EXCEPTION_LAST)
713713
sp = __this_cpu_ist_top_va(VC2);
714714

715715
sync:

0 commit comments

Comments
 (0)