From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>,
Thomas Gleixner <tglx@linutronix.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [PATCH v2] x86: Return to kernel without IRET
Date: Sat, 03 May 2014 12:00:24 -0700 [thread overview]
Message-ID: <53653CC8.1050900@zytor.com> (raw)
In-Reply-To: <CA+55aFzSmm=UiK0WA7yPRojNBuOHhVYSYOFqeyXQUDd0ungNUQ@mail.gmail.com>
On 05/03/2014 06:54 AM, Linus Torvalds wrote:
> On Fri, May 2, 2014 at 11:12 PM, H. Peter Anvin <hpa@zytor.com> wrote:
>> On 05/02/2014 09:32 PM, Linus Torvalds wrote:
>>>
>>> At least as a proof-of-concept, having a code sequence in user mode
>>> trampoline that does
>>>
>>> popq %rsi
>>> popq %r11
>>> retq $128
>>>
>>> and building up a stack in user space at '%rsp-128' that has the
>>> values or rsi/r11/rip should allow us to use 'sysret'. Hmm?
>>
>> That would be a security hole if another userspace thread could muck
>> with the stack.
>
> No, all of the above is in user space, and the pre-restore register
> values for rsi/r11/rip/rsp are all user space values (just not the
> right ones for the "real" return point). So no security issue.
>
> Now, replacing "iret" with "sysret + user-space trampoline" doesn't
> work in general (it gets RF wrong, for example, so it's useless for
> single-stepping and breakpoint handling), but I was more thinking that
> it would be an interesting way to see what the performance impact of a
> faster iret would be.
>
Right, brain failure on my part. I somehow got it in my head you'd run
the above off the user stack while in CPL 0, which would be obviously crazy.
I think this would be rather interesting experiment.
-hpa
prev parent reply other threads:[~2014-05-03 19:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-02 23:53 [PATCH v2] x86: Return to kernel without IRET Andy Lutomirski
2014-05-03 4:03 ` H. Peter Anvin
2014-05-03 11:24 ` Steven Rostedt
2014-05-03 22:19 ` H. Peter Anvin
2014-05-03 23:51 ` Andy Lutomirski
2014-05-04 0:31 ` Andy Lutomirski
2014-05-04 2:15 ` H. Peter Anvin
2014-05-04 2:14 ` H. Peter Anvin
2014-05-05 15:47 ` Andy Lutomirski
2014-05-03 4:32 ` Linus Torvalds
2014-05-03 6:12 ` H. Peter Anvin
2014-05-03 13:54 ` Linus Torvalds
2014-05-03 19:00 ` H. Peter Anvin [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=53653CC8.1050900@zytor.com \
--to=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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