Skip to content

Commit f9544b2

Browse files
keesKAGA-KOKO
authored andcommitted
x86/bugs: Make boot modes __ro_after_init
There's no reason for these to be changed after boot. Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
1 parent 5c30708 commit f9544b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ static const char *spectre_v2_strings[] = {
129129
#undef pr_fmt
130130
#define pr_fmt(fmt) "Spectre V2 : " fmt
131131

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;
133134

134135
void x86_spec_ctrl_set(u64 val)
135136
{
@@ -407,7 +408,7 @@ static void __init spectre_v2_select_mitigation(void)
407408
#undef pr_fmt
408409
#define pr_fmt(fmt) "Speculative Store Bypass: " fmt
409410

410-
static enum ssb_mitigation ssb_mode = SPEC_STORE_BYPASS_NONE;
411+
static enum ssb_mitigation ssb_mode __ro_after_init = SPEC_STORE_BYPASS_NONE;
411412

412413
/* The kernel command line selection */
413414
enum ssb_mitigation_cmd {

0 commit comments

Comments
 (0)