CFI: Add an option to not emit endbr64 for functions with !kcfi_type metadata #1735
Labels
[FEATURE] CFI
Related to building the kernel with Clang Control Flow Integrity
feature-request
Not a bug per-se
On x86_64 when KCFI is patched to FineIBT at runtime, we no longer need the endbr64 instruction at the beginning of address-taken functions, as we won't be calling them indirectly.
As requested by Peter, add an option to Clang to omit the endbr64 instruction from functions that have
!kcfi_type
metadata. This could be an additional command-line flag that's simply passed to LLVM as a module attribute, e.g.-fsanitize-kcfi-omit-endbr
.Note that the current KCFI+IBT combination does require endbr64 to be emitted, so this flag is only relevant when we gain FineIBT support.
@kees @lvwr
The text was updated successfully, but these errors were encountered: