From: Andy Lutomirski <luto@kernel.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, "Bae, Chang Seok" <chang.seok.bae@intel.com>,
Borislav Petkov <bp@alien8.de>,
Peter Zijlstra <peterz@infradead.org>,
Andy Lutomirski <luto@kernel.org>
Subject: [PATCH 0/3] FSGSBASE fix, test, and a semi-related cleanup
Date: Mon, 1 Jul 2019 20:43:18 -0700 [thread overview]
Message-ID: <cover.1562035429.git.luto@kernel.org> (raw)
In -tip, if FSGSBASE and PTI are on, the kernel crashes if SYSENTER
happens with TF set. It also crashes under if a non-NMI paranoid
entry happens for any other reason from kernel mode with user GSBASE
and user CR3, e.g. due to MOV SS shenanigans.
This series fixes the bug. It also adds another test to make sure
we exercise SYSENTER with TF set regardless of what vendor's CPU
we're on, although the test isn't needed to detect the bug: the
single_step_syscall_32 and mov_ss_trap_* tests also trigger it. And
it compiles ignore_sysret out on IA32_EMULATION kernels -- I wasted
a couple minutes while debugging this wondering whether I was
accidentally triggering ignore_sysret.
Andy Lutomirski (3):
selftests/x86: Test SYSCALL and SYSENTER manually with TF set
x86/entry/64: Don't compile ignore_sysret if 32-bit emulation is
enabled
x86/entry/64: Fix and clean up paranoid_exit
arch/x86/entry/entry_64.S | 39 +++---
tools/testing/selftests/x86/Makefile | 5 +-
.../testing/selftests/x86/syscall_arg_fault.c | 112 +++++++++++++++++-
3 files changed, 133 insertions(+), 23 deletions(-)
--
2.21.0
next reply other threads:[~2019-07-02 3:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 3:43 Andy Lutomirski [this message]
2019-07-02 3:43 ` [PATCH 1/3] selftests/x86: Test SYSCALL and SYSENTER manually with TF set Andy Lutomirski
2019-07-02 6:49 ` [tip:x86/cpu] " tip-bot for Andy Lutomirski
2019-07-02 3:43 ` [PATCH 2/3] x86/entry/64: Don't compile ignore_sysret if 32-bit emulation is enabled Andy Lutomirski
2019-07-02 6:49 ` [tip:x86/cpu] " tip-bot for Andy Lutomirski
2019-07-02 3:43 ` [PATCH 3/3] x86/entry/64: Fix and clean up paranoid_exit Andy Lutomirski
2019-07-02 6:50 ` [tip:x86/cpu] " tip-bot for Andy Lutomirski
2019-07-02 3:57 ` [PATCH 0/3] FSGSBASE fix, test, and a semi-related cleanup Andy Lutomirski
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=cover.1562035429.git.luto@kernel.org \
--to=luto@kernel.org \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.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