[libcxx-commits] [libcxx] [PAC] Make __is_function_overridden pauth-aware on ELF platforms (PR #107498)
    Anton Korobeynikov via libcxx-commits 
    libcxx-commits at lists.llvm.org
       
    Mon Sep  9 12:30:35 PDT 2024
    
    
  
================
@@ -116,6 +116,14 @@ _LIBCPP_HIDE_FROM_ABI bool __is_function_overridden(_Ret (*__fptr)(_Args...)) no
   uintptr_t __end   = reinterpret_cast<uintptr_t>(&__stop___lcxx_override);
   uintptr_t __ptr   = reinterpret_cast<uintptr_t>(__fptr);
 
+#  if __has_feature(ptrauth_calls)
+  // We must pass a void* to ptrauth_strip since it only accepts a pointer type. Also, in particular,
+  // we must NOT pass a function pointer, otherwise we will strip the function pointer, and then attempt
+  // to authenticate and re-sign it when casting it to a uintptr_t again, which will fail because we just
+  // stripped the function pointer.
----------------
asl wrote:
Thanks! I clarified the comment :)
https://github.com/llvm/llvm-project/pull/107498
    
    
More information about the libcxx-commits
mailing list