Page MenuHomePhabricator

[AArch64] __builtin_extract_return_addr for PAuth.
Needs ReviewPublic

Authored by danielkiss on Feb 24 2020, 5:08 AM.



This change adds the support for __builtin_extract_return_addr
for ARMv8.3A Pointer Authentications.
Location of the authentication code in the pointer depends on
the system configuration, therefor a dedicated instruction is used for
effectively removing the authentication code without
authenticating the pointer.

Diff Detail

Event Timeline

danielkiss created this revision.Feb 24 2020, 5:08 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 24 2020, 5:08 AM
danielkiss marked 2 inline comments as done.Feb 25 2020, 4:56 AM
danielkiss added inline comments.

CHECK-NEXT: entry:
CHECK-NEXT: ret i8* inttoptr (i64 42 to i8*)


CHECK-PAC: %0 = call i8* @llvm.extractreturnaddress.p0i8.p0i8(i8* inttoptr (i64 42 to i8*))
CHECK-PAC83: %0 = call i8* @llvm.extractreturnaddress.p0i8.p0i8(i8* inttoptr (i64 42 to i8*))
CHECK-BPROT8: %0 = call i8* @llvm.extractreturnaddress.p0i8.p0i8(i8* inttoptr (i64 42 to i8*))
CHECK-BPROT83: %0 = call i8* @llvm.extractreturnaddress.p0i8.p0i8(i8* inttoptr (i64 42 to i8*))

danielkiss added a reviewer: olista01.

rebased and test is updated.