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