Skip to content

Commit b506978

Browse files
amlutoIngo Molnar
authored andcommitted
x86/vm86/32: Fix POPF emulation
POPF would trap if VIP was set regardless of whether IF was set. Fix it. Suggested-by: Stas Sergeev <[email protected]> Reported-by: Bart Oldeman <[email protected]> Signed-off-by: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Fixes: 5ed92a8 ("x86/vm86: Use the normal pt_regs area for vm86") Link: http://lkml.kernel.org/r/ce95f40556e7b2178b6bc06ee9557827ff94bd28.1521003603.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
1 parent 78393fd commit b506978

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/kernel/vm86_32.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,8 @@ void handle_vm86_fault(struct kernel_vm86_regs *regs, long error_code)
727727
return;
728728

729729
check_vip:
730-
if (VEFLAGS & X86_EFLAGS_VIP) {
730+
if ((VEFLAGS & (X86_EFLAGS_VIP | X86_EFLAGS_VIF)) ==
731+
(X86_EFLAGS_VIP | X86_EFLAGS_VIF)) {
731732
save_v86_state(regs, VM86_STI);
732733
return;
733734
}

0 commit comments

Comments
 (0)