x86: Supervisor Mode Access Prevention
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest11 patches 26 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | x86, cpufeature: Add feature bit for SMAParch/ | +1 | 0 replies | |
| 2/11 | x86-32, mm: The WP test should be done on a kernel pagearch/ | +1 | 1 reply | |
| 3/11 | x86, smap: Add CR4 bit for SMAParch/ | +1 | 1 reply | |
| 4/11 | x86, alternative: Use .pushsection/.popsectionarch/ arch/ | +18 | 1 reply | |
| 5/11 | x86, alternative: Add header guards to <asm/alternative-asm.h>arch/ | +5 | 1 reply | |
| 6/11 | x86, smap: Add a header file with macros for STAC/CLACarch/ arch/ | +102 | 1 reply | |
| 7/11 | x86, uaccess: Merge prototypes for clear_user/__clear_userarch/ arch/ arch/ | +3 | 1 reply | |
| 8/11 | x86, smap: Add STAC and CLAC instructions to control user space accessarch/ arch/ arch/ +11 more | +106 | 2 replies | |
| 9/11 | x86, smap: Turn on Supervisor Mode Access PreventionDocumentation/ arch/ | +31 | 1 reply | |
| 10/11 | x86, smap: A page fault due to SMAP is an oopsarch/ | +18 | 1 reply | |
| 11/11 | x86, smap: Reduce the SMAP overhead for signal handlingarch/ arch/ arch/ | +27 | 1 reply |
Reviews trailers per patch
None of the 11 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Ian Campbell | Konrad Rzeszutek Wilk | Andres Salomon | Daniel Drake |
|---|---|---|---|---|
| Series | A-b | A-b T-b | A-b | T-b |
| 1/11 | ||||
| 2/11 | ||||
| 3/11 | ||||
| 4/11 | ||||
| 5/11 | ||||
| 6/11 | ||||
| 7/11 | ||||
| 8/11 | ||||
| 9/11 | ||||
| 10/11 | ||||
| 11/11 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH 00/11] x86: Supervisor Mode Access Prevention
Supervisor Mode Access Prevention (SMAP) is a new security feature disclosed by Intel in revision 014 of the Intel® Architecture Instruction Set Extensions Programming Reference:
http://software.intel.com/sites/default/files/319433-014.pdf
When SMAP is active, the kernel cannot normally access pages that are user space (U=1). Since the kernel does have the need to access user space pages under specific circumstances, an override is provided: the kernel can access user space pages if EFLAGS.AC=1. For system data structures, e.g. descriptor tables, that are accessed by the processor directly, SMAP is active even in CPL 3 regardless of EFLAGS.AC.
SMAP also includes two new instructions, STAC and CLAC, to flip the AC flag more quickly.
Note: patch 01/11 is already in tip:x86/cpufeature.
List of patches:
x86, cpufeature: Add feature bit for SMAP
x86-32, mm: The WP test should be done on a kernel page x86, smap: Add CR4 bit for SMAP
x86, alternative: Use .pushsection/.popsection
x86, alternative: Add header guards to <asm/alternative-asm.h> x86, smap: Add a header file with macros for STAC/CLAC x86, uaccess: Merge prototypes for clear_user/__clear_user x86, smap: Add STAC and CLAC instructions to control user space access x86, smap: Turn on Supervisor Mode Access Prevention
x86, smap: A page fault due to SMAP is an oops
x86, smap: Reduce the SMAP overhead for signal handling
Diff stat:
Documentation/kernel-parameters.txt | 6 ++- arch/x86/Kconfig | 11 ++++ arch/x86/ia32/ia32_signal.c | 12 +++-- arch/x86/ia32/ia32entry.S | 6 ++ arch/x86/include/asm/alternative-asm.h | 9 +++- arch/x86/include/asm/alternative.h | 32 ++++++------ arch/x86/include/asm/cpufeature.h | 1 + arch/x86/include/asm/fpu-internal.h | 10 ++-- arch/x86/include/asm/futex.h | 19 +++++-- arch/x86/include/asm/processor-flags.h | 1 + arch/x86/include/asm/smap.h | 91 ++++++++++++++++++++++++++++++++ arch/x86/include/asm/uaccess.h | 28 ++++++---- arch/x86/include/asm/uaccess_32.h | 3 - arch/x86/include/asm/uaccess_64.h | 3 - arch/x86/include/asm/xsave.h | 10 ++-- arch/x86/kernel/cpu/common.c | 29 ++++++++++- arch/x86/kernel/entry_64.S | 11 ++++- arch/x86/kernel/signal.c | 24 +++++---- arch/x86/lib/copy_user_64.S | 7 +++ arch/x86/lib/copy_user_nocache_64.S | 3 + arch/x86/lib/getuser.S | 10 ++++ arch/x86/lib/putuser.S | 8 +++- arch/x86/lib/usercopy_32.c | 13 ++++- arch/x86/lib/usercopy_64.c | 3 + arch/x86/mm/fault.c | 18 ++++++ arch/x86/mm/init_32.c | 2 +- 26 files changed, 301 insertions(+), 69 deletions(-)