================ @@ -377,13 +395,32 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie, case 'z': cieInfo->fdesHaveAugmentationData = true; break; - case 'P': + case 'P': { cieInfo->personalityEncoding = addressSpace.get8(p); ++p; cieInfo->personalityOffsetInCIE = (uint8_t)(p - cie); - cieInfo->personality = addressSpace - .getEncodedP(p, cieContentEnd, cieInfo->personalityEncoding); + pint_t personality = addressSpace.getEncodedP( + p, cieContentEnd, cieInfo->personalityEncoding, + /*datarelBase=*/0, &resultAddr); +#if __has_feature(ptrauth_calls) + if (personality) { + // The GOT for the personality function was signed address + // authenticated. Manually re-sign with the CIE_Info::personality + // schema. If we could guarantee the encoding of the personality we + // could avoid this by simply giving resultAddr the correct ptrauth + // schema and performing an assignment. + const auto discriminator = ptrauth_blend_discriminator( + &cieInfo->personality, + ptrauth_string_discriminator("CIE_Info::personality")); + void *signedPtr = ptrauth_auth_and_resign( + (void *)personality, ptrauth_key_function_pointer, resultAddr, ---------------- kovdan01 wrote:
> This may be `pauthtest`-abi-specific. @atrosinenko This actually is specific to how things work on linux when `ptrauth_calls` is enabled: see #119361. @ojhunt Could you please add the piece of code provided by @atrosinenko (see above) for non-Apple targets? See, for example, commit e2f8b9d3859eff96442ce04662aefb40debbef3f in branch [pointer-authenticated-unwinding-fix3](https://github.com/kovdan01/llvm-project/commits/pointer-authenticated-unwinding-fix3) in my llvm-project fork. https://github.com/llvm/llvm-project/pull/143230 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits