[PAC][compiler-rt][UBSan] Strip signed vptr instead of authenticating it (#100153)
vptr cannot be authenticated without knowing the class type if it was signed with type discrimination. Co-authored-by: Oliver Hunt <oliver@apple.com>
This commit is contained in:
parent
5e97bfb098
commit
0a6a3c152f
@ -207,7 +207,7 @@ struct VtablePrefix {
|
||||
std::type_info *TypeInfo;
|
||||
};
|
||||
VtablePrefix *getVtablePrefix(void *Vtable) {
|
||||
Vtable = ptrauth_auth_data(Vtable, ptrauth_key_cxx_vtable_pointer, 0);
|
||||
Vtable = ptrauth_strip(Vtable, ptrauth_key_cxx_vtable_pointer);
|
||||
VtablePrefix *Vptr = reinterpret_cast<VtablePrefix*>(Vtable);
|
||||
VtablePrefix *Prefix = Vptr - 1;
|
||||
if (!IsAccessibleMemoryRange((uptr)Prefix, sizeof(VtablePrefix)))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user