x86/kpti: Kernel Page Table Isolation (was KAISER)
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest60 patches 58 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/60 | x86/entry/64/paravirt: Use paravirt-safe macro to access eflagsarch/ arch/ arch/ +1 more | +19 | 2 replies | |
| 2/60 | x86/unwinder/orc: Dont bail on stack overflowarch/ | +12 | 2 replies | |
| 3/60 | x86/unwinder: Handle stack overflows more gracefullyarch/ arch/ arch/ +2 more | +66 | 0 replies | |
| 4/60 | x86/irq: Remove an old outdated comment about context tracking racesarch/ | +0 | 0 replies | |
| 5/60 | x86/irq/64: Print the offending IP in the stack overflow warningarch/ | +2 | 0 replies | |
| 6/60 | x86/entry/64: Allocate and enable the SYSENTER stackarch/ arch/ arch/ +4 more | +10 | 0 replies | |
| 7/60 | x86/dumpstack: Add get_stack_info() support for the SYSENTER stackarch/ arch/ arch/ +1 more | +34 | 0 replies | |
| 8/60 | x86/entry/gdt: Put per-CPU GDT remaps in ascending orderarch/ | +1 | 0 replies | |
| 9/60 | x86/mm/fixmap: Generalize the GDT fixmap mechanism, introduce struct cpu_entry_areaarch/ arch/ arch/ +1 more | +44 | 0 replies | |
| 10/60 | x86/kasan/64: Teach KASAN about the cpu_entry_areaarch/ | +17 | 0 replies | |
| 11/60 | x86/entry: Fix assumptions that the HW TSS is at the beginning of cpu_tssarch/ arch/ arch/ +3 more | +35 | 0 replies | |
| 12/60 | x86/dumpstack: Handle stack overflow on all stacksarch/ | +14 | 0 replies | |
| 13/60 | x86/entry: Move SYSENTER_stack to the beginning of struct tss_structarch/ arch/ | +33 | 0 replies | |
| 14/60 | x86/entry: Remap the TSS into the CPU entry areaarch/ arch/ arch/ +4 more | +58 | 1 reply | |
| 15/60 | x86/entry/64: Separate cpu_current_top_of_stack from TSS.sp0arch/ arch/ arch/ +2 more | +26 | 0 replies | |
| 16/60 | x86/espfix/64: Stop assuming that pt_regs is on the entry stackarch/ | +28 | 0 replies | |
| 17/60 | x86/entry/64: Use a per-CPU trampoline stack for IDT entriesarch/ arch/ arch/ +3 more | +65 | 0 replies | |
| 18/60 | x86/entry/64: Return to userspace from the trampoline stackarch/ | +51 | 0 replies | |
| 19/60 | x86/entry/64: Create a per-CPU SYSCALL entry trampolinearch/ arch/ arch/ +2 more | +84 | 1 reply | |
| 20/60 | x86/entry/64: Move the IST stacks into struct cpu_entry_areaarch/ arch/ arch/ | +57 | 0 replies | |
| 21/60 | x86/entry/64: Remove the SYSENTER stack canaryarch/ arch/ arch/ +1 more | +1 | 0 replies | |
| 22/60 | x86/entry: Clean up the SYSENTER_stack codearch/ arch/ arch/ +4 more | +21 | 1 reply | |
| 23/60 | x86/entry/64: Make cpu_entry_area.tss read-onlyarch/ arch/ arch/ +13 more | +60 | 1 reply | |
| 24/60 | x86/paravirt: Dont patch flush_tlb_singlearch/ | +0 | 1 reply | |
| 25/60 | x86/paravirt: Provide a way to check for hypervisorsarch/ | +15 | 1 reply | |
| 26/60 | x86/cpufeature: Make cpu bugs stickyarch/ arch/ arch/ | +7 | 1 reply | |
| 27/60 | x86/cpufeatures: Add X86_BUG_CPU_INSECUREarch/ arch/ | +6 | 1 reply | |
| 28/60 | x86/mm/kpti: Disable global pages if KERNEL_PAGE_TABLE_ISOLATION=yarch/ | +9 | 1 reply | |
| 29/60 | x86/mm/kpti: Prepare the x86/entry assembly code for entry/exit CR3 switchingarch/ arch/ arch/ | +128 | 0 replies | |
| 30/60 | x86/mm/kpti: Add infrastructure for page table isolationDocumentation/ arch/ arch/ +6 more | +121 | 1 reply | |
| 31/60 | x86/mm/kpti: Add mapping helper functionsarch/ | +139 | 3 replies | |
| 32/60 | x86/mm/kpti: Allow NX poison to be set in p4d/pgdarch/ | +12 | 1 reply | |
| 33/60 | x86/mm/kpti: Allocate a separate user PGDarch/ arch/ | +41 | 2 replies | |
| 34/60 | x86/mm/kpti: Populate user PGDarch/ arch/ | +46 | 1 reply | |
| 35/60 | x86/espfix: Ensure that ESPFIX is visible in user PGDarch/ | +16 | 1 reply | |
| 36/60 | x86/mm/kpti: Add functions to clone kernel PMDsarch/ | +102 | 1 reply | |
| 37/60 | x86mm//kpti: Force entry through trampoline when KPTI activearch/ | +4 | 1 reply | |
| 38/60 | x86/fixmap: Move cpu entry area into a separate PMDarch/ | +10 | 1 reply | |
| 39/60 | x86/mm/kpti: Share cpu_entry_area PMDsarch/ | +18 | 1 reply | |
| 40/60 | x86: PMD align entry textarch/ | +8 | 1 reply | |
| 41/60 | x86/mm/kpti: Share entry text PMDarch/ | +10 | 1 reply | |
| 42/60 | x86/fixmap: Move IDT fixmap into the cpu_entry_area rangearch/ | +1 | 0 replies | |
| 43/60 | x86/fixmap: Add debugstore entries to cpu_entry_areaarch/ arch/ arch/ +2 more | +75 | 1 reply | |
| 44/60 | x86/events/intel/ds: Map debug buffers in fixmaparch/ arch/ | +73 | 0 replies | |
| 45/60 | x86/fixmap: Add ldt entries to user shared fixmaparch/ arch/ | +5 | 0 replies | |
| 46/60 | x86/ldt: Rename ldt_struct->entries memberarch/ arch/ arch/ +4 more | +22 | 0 replies | |
| 47/60 | x86/ldt: Map LDT entries into fixmaparch/ arch/ | +84 | 2 replies | |
| 48/60 | x86/mm: Move the CR3 construction functions to tlbflush.harch/ arch/ arch/ | +31 | 0 replies | |
| 49/60 | x86/mm: Remove hard-coded ASID limit checksarch/ | +18 | 0 replies | |
| 50/60 | x86/mm: Put MMU to hardware ASID translation in one placearch/ | +18 | 0 replies | |
| 51/60 | x86/mm: Allow flushing for future ASID switchesarch/ arch/ | +69 | 6 replies | |
| 52/60 | x86/mm: Abstract switching CR3arch/ | +20 | 0 replies | |
| 53/60 | x86/mm: Use/Fix PCID to optimize user/kernel switchesarch/ arch/ arch/ +6 more | +160 | 3 replies | |
| 54/60 | x86/mm: Optimize RESTORE_CR3arch/ arch/ | +30 | 0 replies | |
| 55/60 | x86/mm: Use INVPCID for __native_flush_tlb_single()arch/ arch/ arch/ | +60 | 4 replies | |
| 56/60 | x86/mm/kpti: Disable native VSYSCALLarch/ | +8 | 1 reply | |
| 57/60 | x86/mm/kpti: Add Kconfigsecurity/ | +10 | 3 replies | |
| 58/60 | x86/mm/debug_pagetables: Add page table directoryarch/ | +10 | 0 replies | |
| 59/60 | x86/mm/dump_pagetables: Check user space page table for WX pagesarch/ arch/ arch/ | +27 | 0 replies | |
| 60/60 | x86/mm/debug_pagetables: Allow dumping current pagetablesarch/ arch/ arch/ | +73 | 0 replies |
Reviews trailers per patch
34 of 60 patches have a Reviewed-by or Acked-by.
| Patch | Thomas Gleixner | Borislav Petkov | Dave Hansen | Peter Zijlstra | Josh Poimboeuf | Juergen Gross |
|---|---|---|---|---|---|---|
| 1/60 | R-b R-b | |||||
| 2/60 | ||||||
| 3/60 | R-b | |||||
| 4/60 | R-b | R-b | ||||
| 5/60 | R-b | R-b | ||||
| 6/60 | R-b | R-b | ||||
| 7/60 | R-b | |||||
| 8/60 | R-b | R-b | ||||
| 9/60 | R-b | R-b | ||||
| 10/60 | ||||||
| 11/60 | R-b | R-b | R-b | |||
| 12/60 | R-b | |||||
| 13/60 | R-b | R-b | ||||
| 14/60 | R-b | R-b | ||||
| 15/60 | R-b | R-b | ||||
| 16/60 | R-b | R-b | ||||
| 17/60 | R-b | R-b | ||||
| 18/60 | R-b | R-b | ||||
| 19/60 | R-b | R-b | ||||
| 20/60 | R-b | R-b | ||||
| 21/60 | R-b | R-b | ||||
| 22/60 | R-b | R-b | ||||
| 23/60 | R-b | |||||
| 24/60 | A-b | R-b | R-b | |||
| 25/60 | R-b | |||||
| 26/60 | R-b | |||||
| 27/60 | ||||||
| 28/60 | R-b | |||||
| 29/60 | R-b | R-b | ||||
| 30/60 | R-b | |||||
| 31/60 | ||||||
| 32/60 | R-b | |||||
| 33/60 | R-b | |||||
| 34/60 | R-b | |||||
| 35/60 | ||||||
| 36/60 | Originally-by | |||||
| 37/60 | R-b | |||||
| 38/60 | ||||||
| 39/60 | R-b | |||||
| 40/60 | R-b | |||||
| 41/60 | R-b | |||||
| 42/60 | ||||||
| 43/60 | ||||||
| 44/60 | ||||||
| 45/60 | ||||||
| 46/60 | ||||||
| 47/60 | ||||||
| 48/60 | ||||||
| 49/60 | ||||||
| 50/60 | ||||||
| 51/60 | ||||||
| 52/60 | ||||||
| 53/60 | ||||||
| 54/60 | ||||||
| 55/60 | ||||||
| 56/60 | ||||||
| 57/60 | ||||||
| 58/60 | ||||||
| 59/60 | ||||||
| 60/60 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.
Cover letter [patch 00/60] x86/kpti: Kernel Page Table Isolation (was KAISER)
This series is a major overhaul of the KAISER patches:
1) Entry code
Mostly the same, except for a handful of fixlets and delta improvements folded into the corresponding patches
New: Map TSS read only into the user space visible mapping
This is 64bit only, as 32bit needs the TSS mapped RW
AMD confirmed that there is no issue with that. It would be nice to get confirmation from Intel as well.
2) Namespace
Several people including Linus requested to change the KAISER name.
We came up with a list of technically correct acronyms:
User Address Space Separation, prefix uass_
Forcefully Unmap Complete Kernel With Interrupt Trampolines, prefix fuckwit_
but we are politically correct people so we settled for
Kernel Page Table Isolation, prefix kpti_
Linus, your call :)
3) The actual isolation patches
- Replaced the magic kaiser_add/remove_mapping() code by mapping everything which needs to be shared with user space into the fixmap
- PMD aligned the shared fixmap so the PTE page can be shared between user and kernel space page tables
- Integrated all fixes and Peters rewrite of the PCID/TLB flush code.
- Restructured the patch set in a way that it is simpler to review
- Got rid of the strange wording of shadow page tables, because they are not shadowish at all. KASAN, virt etc. use shadows, but these tables are actively in use and integral part of the functionality
- Moved the debugfs files into a new directory so they don't clutter the debugfs root directory.
LIMITATIONS:
- allmod/yes config builds fail right now because the fixmap grows too large and breaks the EFI assumptions. This is still investigated.
A possible solution is just to use one of the address space holes and grab a separate pgdir to map the cpu entry area. Not hard to do and it wont change much of the principle of these patches.
TODOs:
- This needs a thorough review again. Sorry.
- Please verify that all fixlets have been integrated. The mail threads are horribly scattered so I might have missed something.
- Rewrite documentation. I dropped the documentation patch as it not longer applies.
- Handle native vsyscalls. Right now the patch set supports only emulation, but it should be possible to support native as well. Nothing urgent, I'd rather prefer to kill them completely.
- Populate a branch with minimal prerequisite patches to apply.
Thanks to Andy Lutomirsky, Peter Zijlstra, Ingo Molnar, Borislav Petkov and Dave Hansen for all the help with this.
The patches apply on top of
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/urgent
and are available from git in
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/kpti
and as tarball from
https://tglx.de/~tglx/patches-kpti-119.tar.bz2 Signature file for the uncompressed tarball https://tglx.de/~tglx/patches-kpti-119.tar.sig
Thanks,
tglx