]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - arch/x86/include/asm/cpufeatures.h
x86/bugs: Add retbleed=ibpb
authorPeter Zijlstra <peterz@infradead.org>
Tue, 14 Jun 2022 21:16:02 +0000 (23:16 +0200)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 19 Jul 2022 19:20:05 +0000 (16:20 -0300)
commit7b3fa544673d1eead1cc35f82a0dd1411c3e4f37
tree4073295c134d499f98ffd32966c656082619c4b3
parent96da12c8db321fb66ae0728c62569035492a19fd
x86/bugs: Add retbleed=ibpb

commit 3ebc170068885b6fc7bedda6c667bb2c4d533159 upstream.

jmp2ret mitigates the easy-to-attack case at relatively low overhead.
It mitigates the long speculation windows after a mispredicted RET, but
it does not mitigate the short speculation window from arbitrary
instruction boundaries.

On Zen2, there is a chicken bit which needs setting, which mitigates
"arbitrary instruction boundaries" down to just "basic block boundaries".

But there is no fix for the short speculation window on basic block
boundaries, other than to flush the entire BTB to evict all attacker
predictions.

On the spectrum of "fast & blurry" -> "safe", there is (on top of STIBP
or no-SMT):

  1) Nothing System wide open
  2) jmp2ret May stop a script kiddy
  3) jmp2ret+chickenbit  Raises the bar rather further
  4) IBPB Only thing which can count as "safe".

Tentative numbers put IBPB-on-entry at a 2.5x hit on Zen2, and a 10x hit
on Zen1 according to lmbench.

  [ bp: Fixup feature bit comments, document option, 32-bit build fix. ]

Suggested-by: Andrew Cooper <Andrew.Cooper3@citrix.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
[cascardo: do not build thunk_*.o without CONFIG_PREEMPTION]
CVE-2022-29900
CVE-2022-29901
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Documentation/admin-guide/kernel-parameters.txt
arch/x86/entry/Makefile
arch/x86/entry/entry.S [new file with mode: 0644]
arch/x86/include/asm/cpufeatures.h
arch/x86/include/asm/nospec-branch.h
arch/x86/kernel/cpu/bugs.c