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
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::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;