]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
x86/bugs: Make boot modes __ro_after_init
authorKees Cook <keescook@chromium.org>
Thu, 3 May 2018 22:03:30 +0000 (15:03 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 14 May 2018 10:27:08 +0000 (12:27 +0200)
There's no reason for these to be changed after boot.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
CVE-2018-3639 (x86)

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/cpu/bugs.c

index cdf39837c80f13304081aaa22feefb633acd5ea7..1b9ddf98b0e5558ad206e4aad556d08205be4279 100644 (file)
@@ -128,7 +128,8 @@ static const char *spectre_v2_strings[] = {
 #undef pr_fmt
 #define pr_fmt(fmt)     "Spectre V2 mitigation: " fmt
 
-static enum spectre_v2_mitigation spectre_v2_enabled = SPECTRE_V2_NONE;
+static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init =
+       SPECTRE_V2_NONE;
 
 void x86_spec_ctrl_set(u64 val)
 {
@@ -366,7 +367,7 @@ retpoline_auto:
 #undef pr_fmt
 #define pr_fmt(fmt)    "Speculative Store Bypass: " fmt
 
-static enum ssb_mitigation ssb_mode = SPEC_STORE_BYPASS_NONE;
+static enum ssb_mitigation ssb_mode __ro_after_init = SPEC_STORE_BYPASS_NONE;
 
 /* The kernel command line selection */
 enum ssb_mitigation_cmd {