-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Strip authentication bits from vtable load address #71128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strip authentication bits from vtable load address #71128
Conversation
The current Darwin arm64e ABI on AArch64 systems using ARMv8.3 & newer cores, adds authentication bits to the vtable pointer address. The vtable address must be in addressable memory, so running it through Process::FixDataAddress will be a no-op on other targets. This was originally a downstream change that I hadn't upstreamed yet, and it was surfaced by Greg's changes in llvm#67599 so I needed to update the local patch, and was reminded that I should upstream this.
@llvm/pr-subscribers-lldb Author: Jason Molenda (jasonmolenda) ChangesThe current Darwin arm64e ABI on AArch64 systems using ARMv8.3 & newer cores, adds authentication bits to the vtable pointer address. The vtable address must be in addressable memory, so running it through Process::FixDataAddress will be a no-op on other targets. This was originally a downstream change that I hadn't upstreamed yet, and it was surfaced by Greg's changes in Full diff: https://github.com/llvm/llvm-project/pull/71128.diff 1 Files Affected:
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index 17c8b43578691c0..6c763ea1558feb1 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -235,14 +235,17 @@ llvm::Expected<LanguageRuntime::VTableInfo>
"failed to get the address of the value");
Status error;
- const lldb::addr_t vtable_load_addr =
+ lldb::addr_t vtable_load_addr =
process->ReadPointerFromMemory(original_ptr, error);
if (!error.Success() || vtable_load_addr == LLDB_INVALID_ADDRESS)
return llvm::createStringError(std::errc::invalid_argument,
"failed to read vtable pointer from memory at 0x%" PRIx64,
original_ptr);
-;
+
+ // The vtable load address can have authentication bits with
+ // AArch64 targets on Darwin.
+ vtable_load_addr = process->FixDataAddress(vtable_load_addr);
// Find the symbol that contains the "vtable_load_addr" address
Address vtable_addr;
|
I'm assuming lack of new tests is because testing is running existing tests on arm64e. LGTM. |
Yeah, lldb can't get the dynamic type in any function that takes a base class argument but a subclass object is passed in (and they have virtual functions), there's tests for that already. But running the testsuite for arm64e requires some boot-args be set so we can't do it on the CI bots yet. |
The current Darwin arm64e ABI on AArch64 systems using ARMv8.3 & newer cores, adds authentication bits to the vtable pointer address. The vtable address must be in addressable memory, so running it through Process::FixDataAddress will be a no-op on other targets. This was originally a downstream change that I hadn't upstreamed yet, and it was surfaced by Greg's changes in llvm#67599 so I needed to update the local patch, and was reminded that I should upstream this. (cherry picked from commit de24b0e)
The current Darwin arm64e ABI on AArch64 systems using ARMv8.3 & newer cores, adds authentication bits to the vtable pointer address. The vtable address must be in addressable memory, so running it through Process::FixDataAddress will be a no-op on other targets. This was originally a downstream change that I hadn't upstreamed yet, and it was surfaced by Greg's changes in llvm#67599 so I needed to update the local patch, and was reminded that I should upstream this. (cherry picked from commit de24b0e)
The current Darwin arm64e ABI on AArch64 systems using ARMv8.3 & newer cores, adds authentication bits to the vtable pointer address. The vtable address must be in addressable memory, so running it through Process::FixDataAddress will be a no-op on other targets.
This was originally a downstream change that I hadn't upstreamed yet, and it was surfaced by Greg's changes in
#67599
so I needed to update the local patch, and was reminded that I should upstream this.