summaryrefslogtreecommitdiff
path: root/base/HidlSupport.cpp
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2017-03-07 16:22:19 -0800
committerYifan Hong <elsk@google.com>2017-03-08 17:08:38 -0800
commit24332ef104a44b4bfb28c56ac2aa44584190e337 (patch)
treee05e95b9f36a3feb2422be3e3572b52e4a13675e /base/HidlSupport.cpp
parent2be9418963c8d36bb1425093d224256e2a94b277 (diff)
downloadlibhidl-24332ef104a44b4bfb28c56ac2aa44584190e337.tar.gz
Disable getDebugInfo address leak for production builds.
On production builds debugfs won't be available, so lshal cannot infer binder relationships anyway. The address leak on production builds also expose a security hole for address space attacks. Added a build-time flag to disable the address leak on user builds. The address will still be exposed for eng and userdebug builds so that lshal can work properly. Bug: 34899586 Test: lshal still works Change-Id: Id1c381fbccad7584c2932deb9212d6996eeefd75
Diffstat (limited to 'base/HidlSupport.cpp')
-rw-r--r--base/HidlSupport.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index 91d56e7..547f7e7 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -77,6 +77,16 @@ vintf::Transport getTransport(const std::string &interfaceName, const std::strin
vintf::VintfObject::GetDeviceHalManifest());
}
+namespace details {
+bool debuggable() {
+#ifdef LIBHIDL_TARGET_DEBUGGABLE
+ return true;
+#else
+ return false;
+#endif
+}
+} // namespace details
+
hidl_handle::hidl_handle() {
mHandle = nullptr;
mOwnsHandle = false;