]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/bhi: Do not set BHI_DIS_S in 32-bit mode
authorPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Mon, 5 May 2025 21:35:12 +0000 (14:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 May 2025 06:24:10 +0000 (08:24 +0200)
commita8a8826bf6559b1106699bc4e92ac4e15770301b
tree28e66a61befec21570303944c885ba7bf3e33fc4
parenta0ff7f679b5d212454d31e6d2ab0b61b5171567a
x86/bhi: Do not set BHI_DIS_S in 32-bit mode

commit 073fdbe02c69c43fb7c0d547ec265c7747d4a646 upstream.

With the possibility of intra-mode BHI via cBPF, complete mitigation for
BHI is to use IBHF (history fence) instruction with BHI_DIS_S set. Since
this new instruction is only available in 64-bit mode, setting BHI_DIS_S in
32-bit mode is only a partial mitigation.

Do not set BHI_DIS_S in 32-bit mode so as to avoid reporting misleading
mitigated status. With this change IBHF won't be used in 32-bit mode, also
remove the CONFIG_X86_64 check from emit_spectre_bhb_barrier().

Suggested-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/cpu/bugs.c
arch/x86/net/bpf_jit_comp.c