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]
Message-ID: <C9BB696F3A938947B10DCAD29FAB8FFA669B3389@CRSMSX101.amr.corp.intel.com>
Date:   Mon, 31 Jul 2017 21:23:45 +0000
From:   "Bae, Chang Seok" <chang.seok.bae@...el.com>
To:     Andy Lutomirski <luto@...nel.org>
CC:     X86 ML <x86@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Borislav Petkov <bpetkov@...e.de>,
        "Brian Gerst" <brgerst@...il.com>, Stas Sergeev <stsp@...t.ru>
Subject: RE: FSGSBASE ABI considerations

> On an FSGSBASE-enabled system, I think we need to provide deterministic, documented, tested behavior.  I can think of three plausible choices:
> 1a. modify_ldt() immediately updates FSBASE and GSBASE all threads that reference the modified selector.
> 1b. modify_ldt() immediatley updates FSBASE and GSBASE on all threads that reference the LDT.
> 2. modify_ldt() leaves FSBASE and GSBASE alone on all threads.
> (2) is trivial to implement, whereas (1a) and (1b) are a bit nasty to implement when FSGSBASE is on.

> The tricky bit is that 32-bit kernels can't do (2), so, if we want modify_ldt() to behave the same on 32-bit and 64-bit kernels, we're stuck with (1).  

While implementing (1) is still unclear for context switch, here is one idea for (1b):
- thread struct has new entry for ldt pointer that last seen
- modify_ldt happens
- ldtr upated for active threads via IPI
- for inactive threads being scheduled in, ldtr updated before __switch_to
- in __switch_to, read ldtr by sldt and compare the new ldt pointer
	sldt is ucode that likely takes only a couple cycles
- mostly matched given modify_ldt is rare
- unmatched, don't write gsbase if gs indicating LDT

> (I think we can implement (2) with acceptable performance on 64-bit non-FSGSBASE kernels if we wanted to.)
Nonetheless, with Andy's argument for (1), (2) might be straightforward assuming that user code already followed the legacy around modify_ldt in 64bit.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ