verify embedded buffer matches address in parent am: fcd86bd0d1 am: 68b6a9027e am: 2e1f5e023c am: 41202fc9c6 am: f39fa2cd1c am: 8115a42569 am: 8ad84271c3
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/libhwbinder/+/14314385
Change-Id: I5ca871564f5b147885fa0208cd0ad09563808901
diff --git a/Binder.cpp b/Binder.cpp
index d86795c..b90639f 100644
--- a/Binder.cpp
+++ b/Binder.cpp
@@ -16,15 +16,21 @@
#include <hwbinder/Binder.h>
-#include <atomic>
-#include <utils/misc.h>
+#include <android-base/macros.h>
+#include <cutils/android_filesystem_config.h>
+#include <cutils/multiuser.h>
#include <hwbinder/BpHwBinder.h>
#include <hwbinder/IInterface.h>
+#include <hwbinder/IPCThreadState.h>
#include <hwbinder/Parcel.h>
+#include <utils/Log.h>
+#include <utils/misc.h>
#include <linux/sched.h>
#include <stdio.h>
+#include <atomic>
+
namespace android {
namespace hardware {
@@ -114,6 +120,15 @@
reply->markSensitive();
}
+ // extra comment to try to force running all tests
+ if (UNLIKELY(code == HIDL_DEBUG_TRANSACTION)) {
+ uid_t uid = IPCThreadState::self()->getCallingUid();
+ if (multiuser_get_app_id(uid) >= AID_APP_START) {
+ ALOGE("Can not call IBase::debug from apps");
+ return PERMISSION_DENIED;
+ }
+ }
+
status_t err = NO_ERROR;
switch (code) {
default:
diff --git a/Parcel.cpp b/Parcel.cpp
index adafaab..b5648a5 100644
--- a/Parcel.cpp
+++ b/Parcel.cpp
@@ -1786,7 +1786,7 @@
releaseObjects();
- if (data) {
+ if (data || desired == 0) {
LOG_ALLOC("Parcel %p: restart from %zu to %zu capacity", this, mDataCapacity, desired);
if (mDataCapacity > desired) {
gParcelGlobalAllocSize -= (mDataCapacity - desired);
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 2bd0463..dfede5a 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,6 +2,14 @@
"presubmit": [
{
"name": "libbinderthreadstateutils_test"
+ },
+ {
+ "name": "SettingsGoogleUnitTests",
+ "options": [
+ {
+ "exclude-annotation": "androidx.test.filters.FlakyTest"
+ }
+ ]
}
]
}