From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: dvlasenk@redhat.com, torvalds@linux-foundation.org, bp@alien8.de,
bartoldeman@gmail.com, hpa@zytor.com,
linux-kernel@vger.kernel.org, jpoimboe@redhat.com, stsp@list.ru,
luto@kernel.org, brgerst@gmail.com, mingo@kernel.org,
tglx@linutronix.de, peterz@infradead.org
Subject: [tip:x86/pti] x86/vm86/32: Fix POPF emulation
Date: Wed, 14 Mar 2018 01:47:19 -0700 [thread overview]
Message-ID: <tip-b5069782453459f6ec1fdeb495d9901a4545fcb5@git.kernel.org> (raw)
In-Reply-To: <ce95f40556e7b2178b6bc06ee9557827ff94bd28.1521003603.git.luto@kernel.org>
Commit-ID: b5069782453459f6ec1fdeb495d9901a4545fcb5
Gitweb: https://git.kernel.org/tip/b5069782453459f6ec1fdeb495d9901a4545fcb5
Author: Andy Lutomirski <luto@kernel.org>
AuthorDate: Tue, 13 Mar 2018 22:03:12 -0700
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 14 Mar 2018 09:21:01 +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@list.ru>
Reported-by: Bart Oldeman <bartoldeman@gmail.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@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@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;
}
prev parent reply other threads:[~2018-03-14 8:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 5:03 [PATCH 0/3] x86/vm86/32: A bugfix and a matching test improvement Andy Lutomirski
2018-03-14 5:03 ` [PATCH 1/3] selftests/x86/entry_from_vm86: Exit with 1 if we fail Andy Lutomirski
2018-03-14 8:46 ` [tip:x86/pti] " tip-bot for Andy Lutomirski
2018-03-14 5:03 ` [PATCH 2/3] selftests/x86/entry_from_vm86: Add test cases for POPF Andy Lutomirski
2018-03-14 8:46 ` [tip:x86/pti] " tip-bot for Andy Lutomirski
2018-03-14 5:03 ` [PATCH 3/3] x86/vm86/32: Fix POPF emulation Andy Lutomirski
2018-03-14 8:47 ` tip-bot for Andy Lutomirski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-b5069782453459f6ec1fdeb495d9901a4545fcb5@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bartoldeman@gmail.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=stsp@list.ru \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).