Turn on pointer-authentication on arm64 as well by default. This means
authorkettenis <kettenis@openbsd.org>
Mon, 15 May 2023 09:58:06 +0000 (09:58 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 15 May 2023 09:58:06 +0000 (09:58 +0000)
we effectively enable -mbranch-protection=standard on arm64 now.

ok deraadt@

gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp

index 524c009..ddc77ec 100644 (file)
@@ -1819,8 +1819,11 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
     if (IndirectBranches)
       CmdArgs.push_back("-mbranch-target-enforce");
   } else {
-    if (Triple.isOSOpenBSD())
+    if (Triple.isOSOpenBSD()) {
+      CmdArgs.push_back("-msign-return-address=non-leaf");
+      CmdArgs.push_back("-msign-return-address-key=a_key");
       CmdArgs.push_back("-mbranch-target-enforce");
+    }
   }
 
   // Handle -msve_vector_bits=<bits>