public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@linux.intel.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Do the x86 kernel entry points need an xabort on TSX cpus?
Date: Fri, 10 Feb 2012 09:18:55 -0800	[thread overview]
Message-ID: <4F35517F.9070904@linux.intel.com> (raw)
In-Reply-To: <CALCETrVWBdp2yyuZ54osq_QQ0a8NKUfOk8stxtuiFWq76FO7JQ@mail.gmail.com>

On 02/09/2012 11:40 PM, Andy Lutomirski wrote:
> [...]
>
>   - Ring transitions: SYSENTER, SYSCALL, SYSEXIT, and SYSRET.
>
> I suspect that many bits of the kernel expect that things they do
> won't unhappen.  For example, it could be fun to do:
>

That's why entering the kernel will cause an abort.  In other words, you 
will ALWAYS abort when you do a read(), and you will never reach your 
_xabort().

> int devrandom = open("/dev/random", O_RDONLY);
> unsigned int abort_code = _xbegin();
>
> if (abort_code&  1) {
>    printf("Your next random byte is %d\n", (int)(abort_code>>  24));
> } else if (abort_code != 0) {
>    printf("Attack failed\n");
> } else {
>    char r;
>    read(devrandom,&r, 1);
>    _xabort(r);
> }

	-hpa


  reply	other threads:[~2012-02-10 17:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10  7:40 Do the x86 kernel entry points need an xabort on TSX cpus? Andy Lutomirski
2012-02-10 17:18 ` H. Peter Anvin [this message]
2012-02-10 17:24   ` Andy Lutomirski
2012-02-10 18:51     ` Simon Farnsworth
2012-02-21 19:30     ` H. Peter Anvin

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=4F35517F.9070904@linux.intel.com \
    --to=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --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