diff options
author | Andy Lutomirski <luto@kernel.org> | 2017-12-12 07:56:45 -0800 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-12-23 21:13:00 +0100 |
commit | f55f0501cbf65ec41cca5058513031b711730b1d (patch) | |
tree | 758e8a8d51b55197f7906b4ee9d57fa5ca0fb2a1 /scripts/insert-sys-cert.c | |
parent | 9f449772a3106bcdd4eb8fdeb281147b0e99fb30 (diff) | |
download | talos-obmc-linux-f55f0501cbf65ec41cca5058513031b711730b1d.tar.gz talos-obmc-linux-f55f0501cbf65ec41cca5058513031b711730b1d.zip |
x86/pti: Put the LDT in its own PGD if PTI is on
With PTI enabled, the LDT must be mapped in the usermode tables somewhere.
The LDT is per process, i.e. per mm.
An earlier approach mapped the LDT on context switch into a fixmap area,
but that's a big overhead and exhausted the fixmap space when NR_CPUS got
big.
Take advantage of the fact that there is an address space hole which
provides a completely unused pgd. Use this pgd to manage per-mm LDT
mappings.
This has a down side: the LDT isn't (currently) randomized, and an attack
that can write the LDT is instant root due to call gates (thanks, AMD, for
leaving call gates in AMD64 but designing them wrong so they're only useful
for exploits). This can be mitigated by making the LDT read-only or
randomizing the mapping, either of which is strightforward on top of this
patch.
This will significantly slow down LDT users, but that shouldn't matter for
important workloads -- the LDT is only used by DOSEMU(2), Wine, and very
old libc implementations.
[ tglx: Cleaned it up. ]
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Laight <David.Laight@aculab.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'scripts/insert-sys-cert.c')
0 files changed, 0 insertions, 0 deletions