Skip to content

Control Flow Enforcement - Part (2)

Yu-cheng Yu linux-arch linux-doc linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9x86/cet: Control protection exception handlerarch/x86/entry/entry_32.S arch/x86/entry/entry_64.S arch/x86/include/asm/traps.h +2 more+71 -12 replies
2/9x86/cet: Add Kconfig option for user-mode shadow stackarch/x86/Kconfig+24 -03 replies
3/9mm: Introduce VM_SHSTK for shadow stack memoryinclude/linux/mm.h mm/internal.h+16 -00 replies
4/9x86/mm: Change _PAGE_DIRTY to _PAGE_DIRTY_HWarch/x86/include/asm/pgtable.h arch/x86/include/asm/pgtable_types.h arch/x86/kernel/relocate_kernel_64.S +1 more+14 -130 replies
5/9x86/mm: Introduce _PAGE_DIRTY_SWarch/x86/include/asm/pgtable.h arch/x86/include/asm/pgtable_types.h include/asm-generic/pgtable.h+105 -120 replies
6/9x86/mm: Introduce ptep_set_wrprotect_flush and related functionsarch/x86/include/asm/pgtable.h include/asm-generic/pgtable.h+73 -97 replies
7/9x86/mm: Shadow stack page fault error checkingarch/x86/include/asm/traps.h arch/x86/mm/fault.c+13 -03 replies
8/9x86/cet: Handle shadow stack page faultmm/memory.c+29 -30 replies
9/9x86/cet: Handle THP/HugeTLB shadow stack page copyingmm/huge_memory.c mm/hugetlb.c+10 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] Control Flow Enforcement - Part (2)

Summary of changes:

Shadow stack kernel config option;
Control protection exception; and
Shadow stack memory management.

The shadow stack PTE needs to be read-only and dirty. Changes are made to:

Use the read-only and hardware dirty combination exclusively for shadow stack;

Use a PTE spare bit to indicate other PTE dirty conditions;

Shadow stack page fault handling.

Yu-cheng Yu (9):
x86/cet: Control protection exception handler x86/cet: Add Kconfig option for user-mode shadow stack
mm: Introduce VM_SHSTK for shadow stack memory x86/mm: Change _PAGE_DIRTY to _PAGE_DIRTY_HW
x86/mm: Introduce _PAGE_DIRTY_SW
x86/mm: Introduce ptep_set_wrprotect_flush and related functions x86/mm: Shadow stack page fault error checking x86/cet: Handle shadow stack page fault
x86/cet: Handle THP/HugeTLB shadow stack page copying

 arch/x86/Kconfig                     |  24 ++++++
 arch/x86/entry/entry_32.S            |   5 ++
 arch/x86/entry/entry_64.S            |   2 +-
 arch/x86/include/asm/pgtable.h       | 149 ++++++++++++++++++++++++++++++-----
 arch/x86/include/asm/pgtable_types.h |  31 +++++---
 arch/x86/include/asm/traps.h         |   5 ++
 arch/x86/kernel/idt.c                |   1 +
 arch/x86/kernel/relocate_kernel_64.S |   2 +-
 arch/x86/kernel/traps.c              |  61 ++++++++++++++
 arch/x86/kvm/vmx.c                   |   2 +-
 arch/x86/mm/fault.c                  |  11 +++
 include/asm-generic/pgtable.h        |  38 +++++++++
 include/linux/mm.h                   |   8 ++
 mm/huge_memory.c                     |  10 ++-
 mm/hugetlb.c                         |   2 +-
 mm/internal.h                        |   8 ++
 mm/memory.c                          |  32 +++++++-
 17 files changed, 353 insertions(+), 38 deletions(-)
Signature · 1 line
2.15.1