Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/bugs: Make boot modes __ro_after_init

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>

authored by

Kees Cook and committed by
Thomas Gleixner
f9544b2b 5c307089

+3 -2
+3 -2
arch/x86/kernel/cpu/bugs.c
··· 129 129 #undef pr_fmt 130 130 #define pr_fmt(fmt) "Spectre V2 : " fmt 131 131 132 - static enum spectre_v2_mitigation spectre_v2_enabled = SPECTRE_V2_NONE; 132 + static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init = 133 + SPECTRE_V2_NONE; 133 134 134 135 void x86_spec_ctrl_set(u64 val) 135 136 { ··· 408 407 #undef pr_fmt 409 408 #define pr_fmt(fmt) "Speculative Store Bypass: " fmt 410 409 411 - static enum ssb_mitigation ssb_mode = SPEC_STORE_BYPASS_NONE; 410 + static enum ssb_mitigation ssb_mode __ro_after_init = SPEC_STORE_BYPASS_NONE; 412 411 413 412 /* The kernel command line selection */ 414 413 enum ssb_mitigation_cmd {