diff options
l--------- | .clang-format | 2 | ||||
l--------- | .clang-format-4 | 1 | ||||
-rw-r--r-- | Android.bp | 16 | ||||
-rw-r--r-- | HeapWalker.cpp | 4 | ||||
-rw-r--r-- | ProcessMappings.cpp | 7 | ||||
-rw-r--r-- | PtracerThread.cpp | 2 |
6 files changed, 18 insertions, 14 deletions
diff --git a/.clang-format b/.clang-format index 9b45e0a..5f196c3 120000 --- a/.clang-format +++ b/.clang-format @@ -1 +1 @@ -.clang-format-4
\ No newline at end of file +../../../build/soong/scripts/system-clang-format-2
\ No newline at end of file diff --git a/.clang-format-4 b/.clang-format-4 deleted file mode 120000 index 8920911..0000000 --- a/.clang-format-4 +++ /dev/null @@ -1 +0,0 @@ -../build/soong/scripts/system-clang-format
\ No newline at end of file @@ -1,3 +1,7 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + cc_defaults { name: "libmemunreachable_defaults", @@ -13,19 +17,15 @@ cc_defaults { target: { android: { static_libs: ["libasync_safe"], + header_libs: ["bionic_libc_platform_headers"], + }, + linux_bionic: { + header_libs: ["bionic_libc_platform_headers"], }, host: { shared_libs: ["liblog"], }, }, - - header_libs: ["bionic_libc_platform_headers"], - - product_variables: { - experimental_mte: { - cflags: ["-DANDROID_EXPERIMENTAL_MTE"], - }, - }, } cc_library { diff --git a/HeapWalker.cpp b/HeapWalker.cpp index dab1029..c602c7f 100644 --- a/HeapWalker.cpp +++ b/HeapWalker.cpp @@ -20,7 +20,9 @@ #include <sys/mman.h> #include <unistd.h> +#if defined(__BIONIC__) #include <bionic/mte.h> +#endif #include <map> #include <utility> @@ -75,7 +77,9 @@ bool HeapWalker::Allocation(uintptr_t begin, uintptr_t end) { // With MTE we set PSTATE.TCO during the access to suppress tag checks. static uintptr_t ReadWordAtAddressUnsafe(uintptr_t word_ptr) __attribute__((no_sanitize("address", "hwaddress"))) { +#if defined(__BIONIC__) ScopedDisableMTE x; +#endif return *reinterpret_cast<uintptr_t*>(word_ptr); } diff --git a/ProcessMappings.cpp b/ProcessMappings.cpp index 8e1be4c..640eacb 100644 --- a/ProcessMappings.cpp +++ b/ProcessMappings.cpp @@ -31,9 +31,10 @@ namespace android { struct ReadMapCallback { ReadMapCallback(allocator::vector<Mapping>& mappings) : mappings_(mappings) {} - void operator()(uint64_t start, uint64_t end, uint16_t flags, uint64_t, ino_t, - const char* name) const { - mappings_.emplace_back(start, end, flags & PROT_READ, flags & PROT_WRITE, flags & PROT_EXEC, + void operator()(uint64_t start, uint64_t end, uint16_t flags, uint64_t, ino_t, const char* name, + bool) const { + mappings_.emplace_back(start, end, flags & PROT_READ, + flags & PROT_WRITE, flags & PROT_EXEC, name); } diff --git a/PtracerThread.cpp b/PtracerThread.cpp index d2fca49..78d6768 100644 --- a/PtracerThread.cpp +++ b/PtracerThread.cpp @@ -68,7 +68,7 @@ class Stack { }; PtracerThread::PtracerThread(const std::function<int()>& func) : child_pid_(0) { - stack_ = std::make_unique<Stack>(PTHREAD_STACK_MIN); + stack_ = std::make_unique<Stack>(128*PAGE_SIZE); if (stack_->top() == nullptr) { MEM_LOG_ALWAYS_FATAL("failed to mmap child stack: %s", strerror(errno)); } |