[compiler-rt] Normalize ptrauth handling in sanitizer runtime (PR #100483)

Zequan Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 14:38:12 PDT 2024


ZequanWu wrote:

With the fix, this is still broken due to invalid pointer conversion:
```
clang++: warning: argument unused during compilation: '--unwindlib=none' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/chromium/src/third_party/llvm/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp:210:12: error: incompatible integer to pointer conversion assigning to 'void *' from 'unsigned long'
  210 |   Vtable = ptrauth_strip(Vtable, ptrauth_key_cxx_vtable_pointer);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/google/home/ayzhao/src/chromium/src/third_party/llvm/compiler-rt/lib/ubsan/../sanitizer_common/sanitizer_ptrauth.h:20:5: note: expanded from macro 'ptrauth_strip'
   20 |     ({                                  \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   21 |       unsigned long ret;                \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   22 |       asm volatile(                     \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   23 |           "mov x30, %1\n\t"             \
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   24 |           "hint #7\n\t"                 \
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   25 |           "mov %0, x30\n\t"             \
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   26 |           "mov x30, xzr\n\t"            \
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   27 |           : "=r"(ret)                   \
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   28 |           : "r"(__value)                \
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   29 |           : "x30");                     \
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |       ret;                              \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |     })
      |     ~~
1 error generated.
```

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


More information about the llvm-commits mailing list