[compiler-rt] [PAC][compiler-rt][UBSan] Strip signed vptr instead of authenticating it (PR #100153)

Oliver Hunt via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 14:36:28 PDT 2024


ojhunt wrote:

> Thanks!
> 
> I suppose that in future preprocessor conditions against vtable discrimination enabled/disabled might be used, and if disabled, old code with `ptrauth_auth_data` and zero discriminator should be OK.

It can't know what the discriminator is unless it's explicitly provided, this particular function may not have abi constraints so it could in theory be updated to take the full discriminator as an argument.

For dynamic_cast we use ptrauth_strip, but have the codegen for dynamic cast perform a forced load+auth of the vtable pointer prior to the call. It's not perfect but is the only really ABI stable solution.

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


More information about the llvm-commits mailing list