All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <brgerst@gmail.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-tip-commits@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Denys Vlasenko <dvlasenk@redhat.com>
Subject: Re: [tip:x86/urgent] x86/entry/32: Add an ASM_CLAC to entry_SYSENTER_32
Date: Thu, 25 Feb 2016 08:47:10 -0500	[thread overview]
Message-ID: <CAMzpN2gqC_QFJjmg8TUWvuO7bd-mFY2xyH7ZOb4fSaH0pafjxg@mail.gmail.com> (raw)
In-Reply-To: <CALCETrWqCnhxvQ5qNp_O_7K7KW1H3FmHiX=mp+C5oeBEx=3YVA@mail.gmail.com>

On Thu, Feb 25, 2016 at 3:03 AM, Andy Lutomirski <luto@amacapital.net> wrote:
>
> On Feb 24, 2016 10:01 PM, "H. Peter Anvin" <hpa@zytor.com> wrote:
>>
>> On 02/24/16 21:53, tip-bot for Andy Lutomirski wrote:
>> > Commit-ID:  04d1d281dcfe683a53cddfab8371fc8bb302b069
>> > Gitweb:
>> > http://git.kernel.org/tip/04d1d281dcfe683a53cddfab8371fc8bb302b069
>> > Author:     Andy Lutomirski <luto@kernel.org>
>> > AuthorDate: Tue, 23 Feb 2016 13:19:29 -0800
>> > Committer:  Ingo Molnar <mingo@kernel.org>
>> > CommitDate: Wed, 24 Feb 2016 08:43:04 +0100
>> >
>> > x86/entry/32: Add an ASM_CLAC to entry_SYSENTER_32
>> >
>> > Both before and after 5f310f739b4c ("x86/entry/32: Re-implement
>> > SYSENTER using the new C path"), we relied on a uaccess very early
>> > in the SYSENTER path to clear AC.  After that change, though, we can
>> > potentially make it all the way into C code with AC set, which
>> > enlarges the attack surface for SMAP bypass by doing SYSENTER with
>> > AC set.
>> >
>> > Strengthen the SMAP protection by addding the missing ASM_CLAC right
>> > at the beginning.
>> >
>>
>> Hmmm... this potentially adds a *lot* of unnecessary cycles to this
>> path.  Could we reinstate the early uaccess?
>
> I think that's more trouble than it's worth, and it'll undo a bunch of the
> context tracking cleanups that deferring it made possible, especially since
> this only matters in a configuration (32-bit SMAP) that no one uses. [1]
>
> *However*, I just realized that I have no idea why the 32-bit sysenter path
> is safe against NT being set.  I fixed it on compat, and now I'm confused as
> to the status on 32-bit.  If we need to fix up NT, I think we can fold AC
> into that.

32-bit still saves eflags in switch_to(), so NT can't leak to other
tasks.  But for consistency it should get the same treatment as 64-bit
(clear NT in sysenter entry and drop saving eflags in switch_to).

--
Brian Gerst

  parent reply	other threads:[~2016-02-25 13:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 21:19 [PATCH] x86/entry/32: Add an ASM_CLAC to entry_SYSENTER_32 Andy Lutomirski
2016-02-24 15:46 ` Brian Gerst
2016-02-24 16:56   ` Andy Lutomirski
2016-02-25  5:53 ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2016-02-25  6:00   ` H. Peter Anvin
2016-02-25  8:07     ` Andy Lutomirski
2016-02-25  8:11       ` Andy Lutomirski
2016-02-25  8:14       ` Ingo Molnar
2016-02-25  8:29         ` Mike Galbraith
2016-02-25  8:40           ` Ingo Molnar
2016-02-25  9:08             ` Mike Galbraith
     [not found]     ` <CALCETrWqCnhxvQ5qNp_O_7K7KW1H3FmHiX=mp+C5oeBEx=3YVA@mail.gmail.com>
2016-02-25 13:47       ` Brian Gerst [this message]
2016-02-25 15:42         ` Brian Gerst
2016-02-25 18:20           ` Andy Lutomirski
2016-02-25 18:30             ` Linus Torvalds
2016-02-25 18:40               ` Andy Lutomirski
2016-02-25 19:31               ` Brian Gerst
2016-02-25 19:39                 ` Andy Lutomirski
2016-02-25 19:49                   ` Brian Gerst
2016-02-25 19:52                     ` Andy Lutomirski
2016-02-25 20:54                 ` Linus Torvalds

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=CAMzpN2gqC_QFJjmg8TUWvuO7bd-mFY2xyH7ZOb4fSaH0pafjxg@mail.gmail.com \
    --to=brgerst@gmail.com \
    --cc=bp@alien8.de \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.