lkml.org 
[lkml]   [2012]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Do the x86 kernel entry points need an xabort on TSX cpus?
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



\
 
 \ /
  Last update: 2012-02-10 18:21    [W:0.048 / U:5.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site