summaryrefslogtreecommitdiff
path: root/libunwindstack/include/unwindstack/JitDebug.h
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2018-10-23 17:42:41 -0700
committerChristopher Ferris <cferris@google.com>2018-10-29 18:08:09 -0700
commit7bede500435e817222954eab31f8fa37b429c4de (patch)
tree695541ab9228349dbcf72d344aa31a8343f055ac /libunwindstack/include/unwindstack/JitDebug.h
parent2508f3e18a4e559a441bc5f5e0ed5ddc30f26e34 (diff)
downloadunwinding-7bede500435e817222954eab31f8fa37b429c4de.tar.gz
Verify that the elf matches the expected arch.
To avoid a case where a malicious app might try and trick the system to create an elf and register object that mismatches, always verify that they are the same arch. Test: Ran unit tests. Change-Id: I66978e9e02f8e4f396856912e7019528ead4838e
Diffstat (limited to 'libunwindstack/include/unwindstack/JitDebug.h')
-rw-r--r--libunwindstack/include/unwindstack/JitDebug.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/libunwindstack/include/unwindstack/JitDebug.h b/libunwindstack/include/unwindstack/JitDebug.h
index ccb473f..f64b04f 100644
--- a/libunwindstack/include/unwindstack/JitDebug.h
+++ b/libunwindstack/include/unwindstack/JitDebug.h
@@ -42,17 +42,9 @@ class JitDebug : public Global {
Elf* GetElf(Maps* maps, uint64_t pc);
- void SetArch(ArchEnum arch);
-
private:
void Init(Maps* maps);
- uint64_t entry_addr_ = 0;
- bool initialized_ = false;
- std::vector<Elf*> elf_list_;
-
- std::mutex lock_;
-
uint64_t (JitDebug::*read_descriptor_func_)(uint64_t) = nullptr;
uint64_t (JitDebug::*read_entry_func_)(uint64_t*, uint64_t*) = nullptr;
@@ -64,6 +56,14 @@ class JitDebug : public Global {
uint64_t ReadEntry64(uint64_t* start, uint64_t* size);
bool ReadVariableData(uint64_t ptr_offset) override;
+
+ void ProcessArch() override;
+
+ uint64_t entry_addr_ = 0;
+ bool initialized_ = false;
+ std::vector<Elf*> elf_list_;
+
+ std::mutex lock_;
};
} // namespace unwindstack