lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 20 Dec 2019 12:35:27 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Brian Gerst' <brgerst@...il.com>
CC:     Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        "H . Peter Anvin" <hpa@...or.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        "Oleg Nesterov" <oleg@...hat.com>
Subject: RE: [PATCH] x86: Remove force_iret()

From: Brian Gerst
> Sent: 20 December 2019 12:18
...
> > Is it ever possible for any of the segment registers to refer to the LDT
> > and for another thread to invalidate the entries 'very late' ?
> > So even though the values were valid when changed, they are
> > invalid during the 'return to user' sequence.
> 
> Not in the SYSRET case, where the kernel requires that CS and SS are
> static segments in the GDT.  Any userspace context that uses LDT
> segments for CS/SS must return with IRET.  There is fault handling for
> IRET (fixup_bad_iret()) for this case.

Ok - It is a long time since i looked at these 'syscall' instructions.

...
> > Is it actually cheaper to properly validate the segment registers,
> > or take the 'hit' of the slightly slower IRET path and get the cpu
> > to do it for you?
> 
> SYSRET is faster because it avoids segment table lookups and
> permission checks for CS and SS.  It simply sets the selectors to
> values set in an MSR and the attributes (base, limit, etc.) to fixed
> values.  It is up to the OS to make sure the actual segment
> descriptors in memory match those default attributes.

I wonder how much difference that make when 'page table separation'
is used?

I guess the loading of ds/es/fs/gs can fault - but that it no harder
to handle than in the IRET case.

	David

Anyway, off until the new year now.

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ