Skip to content

x86/ibt: FineIBT-BHI

Peter Zijlstra lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 45 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14x86/cfi: Wreck things...arch/x86/crypto/aesni-intel_asm.S arch/x86/entry/calling.h arch/x86/entry/entry_64.S +10 more+48 -153 replies
2/14x86/boot: Mark start_secondary() with __noendbrarch/x86/kernel/smpboot.c include/linux/objtool.h+12 -40 replies
3/14x86/alternative: Simplify callthunk patchingarch/x86/include/asm/alternative.h arch/x86/kernel/alternative.c arch/x86/kernel/callthunks.c +3 more+13 -391 reply
4/14objtool/x86: Add .tail_call_sitesarch/x86/kernel/vmlinux.lds.S tools/objtool/check.c tools/objtool/include/objtool/objtool.h +1 more+58 -53 replies
5/14objtool: Rename the skylake hack to --direct-callscripts/Makefile.lib tools/objtool/builtin-check.c tools/objtool/check.c +1 more+13 -170 replies
6/14x86/traps: Prepare for ENDBR poison UD1 usagearch/x86/include/asm/bug.h arch/x86/include/asm/ibt.h arch/x86/kernel/cet.c +1 more+90 -310 replies
7/14x86/ibt: Clean up is_endbr()arch/x86/events/core.c arch/x86/include/asm/ibt.h arch/x86/kernel/alternative.c +3 more+22 -337 replies
8/14x86/ibt: Clean up poison_endbr()arch/x86/kernel/alternative.c+35 -70 replies
9/14x86/ibt: Implement IBT+arch/x86/Kconfig arch/x86/include/asm/alternative.h arch/x86/include/asm/cfi.h +7 more+144 -146 replies
10/14x86/early_printk: Harden early_serialarch/x86/kernel/early_printk.c+25 -260 replies
11/14llvm: kCFI pointer stuffllvm/lib/Target/X86/X86AsmPrinter.cpp llvm/lib/Target/X86/X86MCInstLower.cpp+39 -27 replies
12/14x86: Hacks for hacked up llvmarch/x86/Kconfig arch/x86/include/asm/linkage.h+6 -40 replies
13/14x86: BHI stubsarch/x86/include/asm/cfi.h arch/x86/kernel/alternative.c arch/x86/lib/Makefile +1 more+708 -015 replies
14/14x86/fineibt: Add FineIBT+BHI mitigationarch/x86/include/asm/cfi.h arch/x86/kernel/alternative.c arch/x86/net/bpf_jit_comp.c +1 more+98 -173 replies

Reviews trailers per patch

1 of 14 patches has a Reviewed-by or Acked-by.

PatchAlexei StarovoitovAndrii Nakryiko
1/14
2/14
3/14
4/14
5/14
6/14
7/14A-b A-b
8/14
9/14
10/14
11/14
12/14
13/14
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/14] x86/ibt: FineIBT-BHI

Hi all,

Since I got back from Vienna sick as a dog, I figured I'd do something simple like rebase some previous work...

The thing I picked was FineIBT-BHI, an alternative mitigation for the native-BHI issue, something that I implemented somewhere late last year while the whole thing was still embargoed.

Specifically the paper mentions that FineIBT should avoid the problem, but showed that the IBT implementation of current chips falls somewhat short of the desired semantics and there's still a hole.

This here scheme (by Alyssa?) closes the hole and performs favourably (Scott?).

The major stumbling block is that it relies on a compiler extension of the kCFI infrastructure -- and while I did me a llvm POC, a real compiler person should very much take the idea and do it right (Joao?).

Notably, GCC doesn't currently implement even basic kCFI:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107048
https://lore.kernel.org/lkml/[email protected]/

(an interested GCC person wanting to help finish that patchset and add x86-64 support would be much appreciated)

Anyway.... obviously this wasn't at all simple, nothing ever is.

The first many (10) patches are massaging/hardening the existing (Fine)IBT implementation and all that should be mergable without fancy new compiler stuff.

The last few (4) patches, starting with the llvm patch, is the actual FineIBT-BHI mitigation.

The kernel patches are also available at:

git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/ibt
git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/fineibt-bhi

The whole series boots and builds the next kernel on my ADL -- using the custom LLVM.