x86/vm86/32: Fix POPF emulation

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Mar 19 02:59:08 PDT 2018


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b5069782453459f6ec1fdeb495d9901a4545fcb5
Commit:     b5069782453459f6ec1fdeb495d9901a4545fcb5
Parent:     78393fdde2a456cafa414b171c90f26a3df98b20
Author:     Andy Lutomirski <luto at kernel.org>
AuthorDate: Tue Mar 13 22:03:12 2018 -0700
Committer:  Ingo Molnar <mingo at kernel.org>
CommitDate: Wed Mar 14 09:21:01 2018 +0100

    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 <stsp at list.ru>
    Reported-by: Bart Oldeman <bartoldeman at gmail.com>
    Signed-off-by: Andy Lutomirski <luto at kernel.org>
    Cc: Borislav Petkov <bp at alien8.de>
    Cc: Brian Gerst <brgerst at gmail.com>
    Cc: Denys Vlasenko <dvlasenk at redhat.com>
    Cc: H. Peter Anvin <hpa at zytor.com>
    Cc: Josh Poimboeuf <jpoimboe at redhat.com>
    Cc: Linus Torvalds <torvalds at linux-foundation.org>
    Cc: Peter Zijlstra <peterz at infradead.org>
    Cc: Thomas Gleixner <tglx at linutronix.de>
    Cc: stable at vger.kernel.org
    Fixes: 5ed92a8ab71f ("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 <mingo at kernel.org>
---
 arch/x86/kernel/vm86_32.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index 5edb27f1a2c4..9d0b5af7db91 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -727,7 +727,8 @@ void handle_vm86_fault(struct kernel_vm86_regs *regs, long error_code)
 	return;
 
 check_vip:
-	if (VEFLAGS & X86_EFLAGS_VIP) {
+	if ((VEFLAGS & (X86_EFLAGS_VIP | X86_EFLAGS_VIF)) ==
+	    (X86_EFLAGS_VIP | X86_EFLAGS_VIF)) {
 		save_v86_state(regs, VM86_STI);
 		return;
 	}



More information about the linux-mtd-cvs mailing list