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/20230325081117.93245-1-ashimida.1990@gmail.com/
(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.