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 <thomas.lendacky@amd.com> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20211021080833.30875-2-joro@8bytes.org
1 parent e7d445a commit 5681981

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)