Retpolines are now disabled by default in #OpenBSD -current, in favour of a kernel based mitigation using IBPB (indirect branch predictor barrier).
kettenis@ modified src/gnu/llvm/lld/ELF/Driver.cpp: Revert the change that enables retpoline PLTs by default. While these provide a mitigation against branch speculation attacks, they also make IBT control flow integrity less effective. Our kernel now uses IBPB to as a mitigation against branch speculation attacks, so we can disable retpoline PLTs again.
ok deraadt@
guenther@ modified src/sys/arch/amd64/amd64/*: Retpolines are an anti-pattern for IBT, so we need to shift protecting userspace from cross-process BTI to the kernel. Have each CPU track the last pmap run on in userspace and the last vmm VCPU in guest-mode and use the IBPB msr to flush predictors right before running in userspace on a different pmap or entering guest-mode on a different VCPU.
Codepatch-nop the userspace bits and conditionalize the vmm bits to keep working if IBPB isn't supported.ok deraadt@ kettenis@
IBT was enabled by default in the kernel/userland in #OpenBSD 7,4, and is supported on Intel Tiger Lake (Core gen 11) CPUs and later.
https://bsd.network/users/brynet/statuses/110687785303109457