diff options
author | Oliver Hunt <oliver@apple.com> | 2024-07-22 18:29:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-22 18:29:06 -0700 |
commit | 4dcd91aea3858fe60c65701a92060a04f789886f (patch) | |
tree | 88182008cde9784c9c1aae6d195abc8fd6652e4d /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | d3fb41dddc11b0ebc338a3b9e6a5ab7288ff7d1d (diff) | |
download | llvm-4dcd91aea3858fe60c65701a92060a04f789886f.zip llvm-4dcd91aea3858fe60c65701a92060a04f789886f.tar.gz llvm-4dcd91aea3858fe60c65701a92060a04f789886f.tar.bz2 |
[PAC] Implement authentication for C++ member function pointers (#99576)
Introduces type based signing of member function pointers. To support
this discrimination schema we no longer emit member function pointer to
virtual methods and indices into a vtable but migrate to using thunks.
This does mean member function pointers are no longer necessarily
directly comparable, however as such comparisons are UB this is
acceptable.
We derive the discriminator from the C++ mangling of the type of the
pointer being authenticated.
Co-Authored-By: Akira Hatanaka ahatanaka@apple.com
Co-Authored-By: John McCall rjmccall@apple.com
Co-authored-by: Ahmed Bougacha <ahmed@bougacha.org>
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 424fe53..78c47d8 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1501,6 +1501,8 @@ void CompilerInvocation::setDefaultPointerAuthOptions( PointerAuthSchema(Key::ASDA, false, Discrimination::None); Opts.CXXVirtualFunctionPointers = Opts.CXXVirtualVariadicFunctionPointers = PointerAuthSchema(Key::ASIA, true, Discrimination::Decl); + Opts.CXXMemberFunctionPointers = + PointerAuthSchema(Key::ASIA, false, Discrimination::Type); } } |