0121-x86-cpufeature-Add-User-Mode-Instruction-Prevention-.patch 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. From c2c378764103c12f96d1e913c8a2ffe3af3b1360 Mon Sep 17 00:00:00 2001
  2. From: Ricardo Neri <[email protected]>
  3. Date: Sun, 5 Nov 2017 18:27:51 -0800
  4. Subject: [PATCH 121/242] x86/cpufeature: Add User-Mode Instruction Prevention
  5. definitions
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. CVE-2017-5754
  10. [ Note, this is a Git cherry-pick of the following commit: (limited to the cpufeatures.h file)
  11. 3522c2a6a4f3 ("x86/cpufeature: Add User-Mode Instruction Prevention definitions")
  12. ... for easier x86 PTI code testing and back-porting. ]
  13. User-Mode Instruction Prevention is a security feature present in new
  14. Intel processors that, when set, prevents the execution of a subset of
  15. instructions if such instructions are executed in user mode (CPL > 0).
  16. Attempting to execute such instructions causes a general protection
  17. exception.
  18. The subset of instructions comprises:
  19. * SGDT - Store Global Descriptor Table
  20. * SIDT - Store Interrupt Descriptor Table
  21. * SLDT - Store Local Descriptor Table
  22. * SMSW - Store Machine Status Word
  23. * STR - Store Task Register
  24. This feature is also added to the list of disabled-features to allow
  25. a cleaner handling of build-time configuration.
  26. Signed-off-by: Ricardo Neri <[email protected]>
  27. Reviewed-by: Thomas Gleixner <[email protected]>
  28. Reviewed-by: Borislav Petkov <[email protected]>
  29. Cc: Andrew Morton <[email protected]>
  30. Cc: Andy Lutomirski <[email protected]>
  31. Cc: Borislav Petkov <[email protected]>
  32. Cc: Brian Gerst <[email protected]>
  33. Cc: Chen Yucong <[email protected]>
  34. Cc: Chris Metcalf <[email protected]>
  35. Cc: Dave Hansen <[email protected]>
  36. Cc: Denys Vlasenko <[email protected]>
  37. Cc: Fenghua Yu <[email protected]>
  38. Cc: H. Peter Anvin <[email protected]>
  39. Cc: Huang Rui <[email protected]>
  40. Cc: Jiri Slaby <[email protected]>
  41. Cc: Jonathan Corbet <[email protected]>
  42. Cc: Josh Poimboeuf <[email protected]>
  43. Cc: Linus Torvalds <[email protected]>
  44. Cc: Masami Hiramatsu <[email protected]>
  45. Cc: Michael S. Tsirkin <[email protected]>
  46. Cc: Paolo Bonzini <[email protected]>
  47. Cc: Paul Gortmaker <[email protected]>
  48. Cc: Peter Zijlstra <[email protected]>
  49. Cc: Ravi V. Shankar <[email protected]>
  50. Cc: Shuah Khan <[email protected]>
  51. Cc: Tony Luck <[email protected]>
  52. Cc: Vlastimil Babka <[email protected]>
  53. Cc: [email protected]
  54. Link: http://lkml.kernel.org/r/1509935277-22138-7-git-send-email-ricardo.neri-calderon@linux.intel.com
  55. Signed-off-by: Ingo Molnar <[email protected]>
  56. (cherry picked from commit a8b4db562e7283a1520f9e9730297ecaab7622ea)
  57. Signed-off-by: Andy Whitcroft <[email protected]>
  58. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  59. (cherry picked from commit 6193ddb9de38665ba45f7f17dd9713baec3673ca)
  60. Signed-off-by: Fabian Grünbichler <[email protected]>
  61. ---
  62. arch/x86/include/asm/cpufeatures.h | 1 +
  63. 1 file changed, 1 insertion(+)
  64. diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
  65. index 6db782ed9cdb..0ea630bb3e74 100644
  66. --- a/arch/x86/include/asm/cpufeatures.h
  67. +++ b/arch/x86/include/asm/cpufeatures.h
  68. @@ -295,6 +295,7 @@
  69. /* Intel-defined CPU features, CPUID level 0x00000007:0 (ECX), word 16 */
  70. #define X86_FEATURE_AVX512VBMI (16*32+ 1) /* AVX512 Vector Bit Manipulation instructions*/
  71. +#define X86_FEATURE_UMIP (16*32+ 2) /* User Mode Instruction Protection */
  72. #define X86_FEATURE_PKU (16*32+ 3) /* Protection Keys for Userspace */
  73. #define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */
  74. #define X86_FEATURE_AVX512_VBMI2 (16*32+ 6) /* Additional AVX512 Vector Bit Manipulation Instructions */
  75. --
  76. 2.14.2