File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -3123,14 +3123,19 @@ early_param("spec_rstack_overflow", srso_parse_cmdline);
3123
3123
3124
3124
static void __init srso_select_mitigation (void )
3125
3125
{
3126
- if (!boot_cpu_has_bug (X86_BUG_SRSO ) || cpu_mitigations_off ())
3126
+ if (!boot_cpu_has_bug (X86_BUG_SRSO )) {
3127
3127
srso_mitigation = SRSO_MITIGATION_NONE ;
3128
-
3129
- if (srso_mitigation == SRSO_MITIGATION_NONE )
3130
3128
return ;
3129
+ }
3131
3130
3132
- if (srso_mitigation == SRSO_MITIGATION_AUTO )
3133
- srso_mitigation = SRSO_MITIGATION_SAFE_RET ;
3131
+ if (srso_mitigation == SRSO_MITIGATION_AUTO ) {
3132
+ if (should_mitigate_vuln (X86_BUG_SRSO )) {
3133
+ srso_mitigation = SRSO_MITIGATION_SAFE_RET ;
3134
+ } else {
3135
+ srso_mitigation = SRSO_MITIGATION_NONE ;
3136
+ return ;
3137
+ }
3138
+ }
3134
3139
3135
3140
/* Zen1/2 with SMT off aren't vulnerable to SRSO. */
3136
3141
if (boot_cpu_data .x86 < 0x19 && !cpu_smt_possible ()) {
You can’t perform that action at this time.
0 commit comments