From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Andy Lutomirski <luto@kernel.org>
Cc: Nadav Amit <nadav.amit@gmail.com>,
Pavel Emelyanov <xemul@parallels.com>,
Cyrill Gorcunov <gorcunov@openvz.org>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Willy Tarreau <w@1wt.eu>, X86 ML <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC v2 4/6] x86: Disable PTI on compatibility mode
Date: Fri, 16 Feb 2018 00:35:28 +0000 [thread overview]
Message-ID: <d1095ed0-1a4e-823e-d65a-558ea53dfce5@citrix.com> (raw)
In-Reply-To: <CA+55aFypED6i6pESAnk_RPUon_cyvdP3g-QZg2gspEBNAQWvmQ@mail.gmail.com>
On 16/02/2018 00:08, Linus Torvalds wrote:
> On Thu, Feb 15, 2018 at 3:29 PM, Andy Lutomirski <luto@kernel.org> wrote:
>> Linus, how would you feel about, by default, preventing 64-bit
>> programs from long-jumping to __USER32_CS and vice versa?
> How? It's a standard GDT entry. Are you going to start switching the
> GDT around every context switch?
>
> I *thought* that user space can just do a far jump on its own. But
> it's so long since I had to care that I may have forgotten all the
> requirements for going between "compatibility mode" and real long
> mode.
Yes - it is just a straight far jump to switch between compat and long mode.
A evil^W cunning programmer can use the 286 world view and disable
segments by clearing the present bit to yield #NP[sel] on use, which is
liable to be rather faster than LGDT on a context switch.
Alternatively, set both the L and D (code segments only), or playing
with DPL/type can all yield #GP[sel] on use, but these probably aren't
as good options.
~Andrew
next prev parent reply other threads:[~2018-02-16 0:35 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-15 16:35 [PATCH RFC v2 0/6] x86: Disabling PTI in compatibility mode Nadav Amit
2018-02-15 16:35 ` [PATCH RFC v2 1/6] x86: Skip PTI when disable indication is set Nadav Amit
2018-02-15 18:10 ` Dave Hansen
2018-02-15 19:51 ` Andy Lutomirski
2018-02-15 20:51 ` Nadav Amit
2018-02-15 23:35 ` Andy Lutomirski
2018-02-15 16:35 ` [PATCH RFC v2 2/6] x86: Save pti_disable for each mm_context Nadav Amit
2018-02-15 16:35 ` [PATCH RFC v2 3/6] x86: Switching page-table isolation Nadav Amit
2018-02-15 16:36 ` [PATCH RFC v2 4/6] x86: Disable PTI on compatibility mode Nadav Amit
2018-02-15 20:02 ` Andy Lutomirski
2018-02-15 20:58 ` Nadav Amit
2018-02-15 23:29 ` Andy Lutomirski
2018-02-16 0:08 ` Linus Torvalds
2018-02-16 0:22 ` Nadav Amit
2018-02-16 0:42 ` Linus Torvalds
2018-02-16 3:03 ` Andy Lutomirski
2018-02-16 4:55 ` Nadav Amit
2018-02-16 0:35 ` Andrew Cooper [this message]
2018-02-16 15:20 ` Andy Lutomirski
2018-02-16 7:11 ` Cyrill Gorcunov
2018-02-16 22:07 ` Dmitry Safonov
2018-02-16 22:11 ` Nadav Amit
2018-02-16 16:25 ` Dmitry Safonov
2018-02-15 16:36 ` [PATCH RFC v2 5/6] x86: Use global pages when PTI is disabled Nadav Amit
2018-02-15 16:54 ` Dave Hansen
2018-02-15 17:36 ` Nadav Amit
2018-02-15 17:47 ` Nadav Amit
2018-02-15 18:08 ` Dave Hansen
2018-02-15 19:53 ` Andy Lutomirski
2018-02-15 20:32 ` Dave Hansen
2018-02-15 20:45 ` Nadav Amit
2018-02-15 16:36 ` [PATCH RFC v2 6/6] selftest: x86: test using CS64 on compatibility-mode Nadav Amit
2018-02-16 0:21 ` [PATCH RFC v2 0/6] x86: Disabling PTI in compatibility mode Dave Hansen
2018-02-16 0:25 ` Nadav Amit
2018-02-16 0:42 ` Dave Hansen
2018-02-16 0:48 ` Nadav Amit
2018-02-16 0:45 ` Andrew Cooper
2018-02-16 0:51 ` Nadav Amit
2018-02-16 1:04 ` Andrew Cooper
2018-02-16 3:05 ` 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=d1095ed0-1a4e-823e-d65a-558ea53dfce5@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=dave.hansen@linux.intel.com \
--cc=gorcunov@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=w@1wt.eu \
--cc=x86@kernel.org \
--cc=xemul@parallels.com \
/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