]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fuzz cleanups
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2026 06:23:54 +0000 (08:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2026 06:23:54 +0000 (08:23 +0200)
queue-6.1/x86-bugs-enable-ibpb-flush-on-bpf-jit-allocation.patch

index c82101accecb7a8062d9ae1365875359868cdfeb..ba6c3a97742b322ef7e6f53bad0977e34619f792 100644 (file)
@@ -25,17 +25,15 @@ Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- arch/x86/include/asm/nospec-branch.h |  4 +++
- arch/x86/kernel/cpu/bugs.c           | 50 +++++++++++++++++++++++++---
+ arch/x86/include/asm/nospec-branch.h |    4 ++
+ arch/x86/kernel/cpu/bugs.c           |   50 +++++++++++++++++++++++++++++++----
  2 files changed, 49 insertions(+), 5 deletions(-)
 
-diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
-index 818a5913f21950..40842aabd21783 100644
 --- a/arch/x86/include/asm/nospec-branch.h
 +++ b/arch/x86/include/asm/nospec-branch.h
-@@ -280,6 +280,10 @@ extern void srso_alias_untrain_ret(void);
extern void entry_untrain_ret(void);
extern void entry_ibpb(void);
+@@ -293,6 +293,10 @@ void srso_safe_ret(void);
void srso_alias_safe_ret(void);
void handle_interrupted_saferet(struct pt_regs *regs);
  
 +#ifdef CONFIG_BPF_JIT
 +extern void bpf_arch_ibpb(void);
@@ -44,8 +42,6 @@ index 818a5913f21950..40842aabd21783 100644
  #ifdef CONFIG_X86_64
  extern void clear_bhb_loop(void);
  #endif
-diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
-index a0b362ac50a1b3..662d13612ef4b2 100644
 --- a/arch/x86/kernel/cpu/bugs.c
 +++ b/arch/x86/kernel/cpu/bugs.c
 @@ -16,6 +16,7 @@
@@ -56,7 +52,7 @@ index a0b362ac50a1b3..662d13612ef4b2 100644
  
  #include <asm/spec-ctrl.h>
  #include <asm/cmdline.h>
-@@ -1298,8 +1299,21 @@ static inline const char *spectre_v2_module_string(void)
+@@ -1298,8 +1299,21 @@ static inline const char *spectre_v2_mod
  {
        return spectre_v2_bad_module ? " - vulnerable module loaded" : "";
  }
@@ -78,7 +74,7 @@ index a0b362ac50a1b3..662d13612ef4b2 100644
  #endif
  
  #define SPECTRE_V2_LFENCE_MSG "WARNING: LFENCE mitigation is not recommended for this CPU, data leaks possible!\n"
-@@ -1780,8 +1794,7 @@ static void __init bhi_select_mitigation(void)
+@@ -1780,8 +1794,7 @@ static void __init bhi_select_mitigation
                return;
  
        /* Retpoline mitigates against BHI unless the CPU has RRSBA behavior */
@@ -88,7 +84,7 @@ index a0b362ac50a1b3..662d13612ef4b2 100644
                spec_ctrl_disable_kernel_rrsba();
                if (rrsba_disabled)
                        return;
-@@ -1803,6 +1816,27 @@ static void __init bhi_select_mitigation(void)
+@@ -1803,6 +1816,27 @@ static void __init bhi_select_mitigation
        pr_info("Spectre BHI mitigation: SW BHB clearing on syscall\n");
  }
  
@@ -116,7 +112,7 @@ index a0b362ac50a1b3..662d13612ef4b2 100644
  static void __init spectre_v2_select_mitigation(void)
  {
        enum spectre_v2_mitigation_cmd cmd = spectre_v2_parse_cmdline();
-@@ -1985,6 +2019,14 @@ static void __init spectre_v2_select_mitigation(void)
+@@ -1985,6 +2019,14 @@ static void __init spectre_v2_select_mit
                pr_info("Enabling Restricted Speculation for firmware calls\n");
        }
  
@@ -131,7 +127,7 @@ index a0b362ac50a1b3..662d13612ef4b2 100644
        /* Set up IBPB and STIBP depending on the general spectre V2 command */
        spectre_v2_cmd = cmd;
  }
-@@ -3157,9 +3199,7 @@ static const char *spectre_bhi_state(void)
+@@ -3157,9 +3199,7 @@ static const char *spectre_bhi_state(voi
                return "; BHI: BHI_DIS_S";
        else if (boot_cpu_has(X86_FEATURE_CLEAR_BHB_LOOP))
                return "; BHI: SW loop, KVM: SW loop";
@@ -142,6 +138,3 @@ index a0b362ac50a1b3..662d13612ef4b2 100644
                return "; BHI: Retpoline";
        else if (boot_cpu_has(X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT))
                return "; BHI: Vulnerable, KVM: SW loop";
--- 
-2.53.0
-