[clang] [llvm] [ARM][KCFI] Add backend support for Kernel Control-Flow Integrity (PR #163698)

Ard Biesheuvel via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 17 00:33:27 PDT 2025


================
@@ -687,7 +687,9 @@ static void addKCFIPass(const Triple &TargetTriple, const LangOptions &LangOpts,
                         PassBuilder &PB) {
   // If the back-end supports KCFI operand bundle lowering, skip KCFIPass.
   if (TargetTriple.getArch() == llvm::Triple::x86_64 ||
-      TargetTriple.isAArch64(64) || TargetTriple.isRISCV())
+      TargetTriple.isAArch64(64) || TargetTriple.isRISCV() ||
+      TargetTriple.getArch() == llvm::Triple::arm ||
----------------
ardbiesheuvel wrote:

We are talking about Thumb2 here right? Any reason we cannot just enable that too? Does it have to do with the encoding of the EOR instructions? Because in that case, I will reiterate the point I made previously, i.e., that we should be able to decode the expected signature in the exception handler by XOR'ing with the observed signature, and not look at the opcodes at all.

https://github.com/llvm/llvm-project/pull/163698


More information about the cfe-commits mailing list