summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2023-03-27 20:42:33 +0000
committer Steven Moreland <smoreland@google.com> 2023-03-27 20:47:56 +0000
commit6d90e403303f989918f0dd86d094f75b761c23f8 (patch)
tree8998f8cfdacdd5f92512b7ad9b5528e045e72abd
parenta7e060a986b63a081a26aae4d9a9c24468e8c765 (diff)
binder - include calling PID/UID in uncaught remote exception code
Bug: 150808347 Change-Id: I7c8e69e1f71910b7e1358b91646b23380cce74a3 Test: N/A
-rw-r--r--core/jni/android_util_Binder.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index a7c7d0ba35bc..b24dc8a9e63b 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -413,9 +413,13 @@ protected:
if (env->ExceptionCheck()) {
ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred());
- binder_report_exception(env, excep.get(),
- "*** Uncaught remote exception! "
- "(Exceptions are not yet supported across processes.)");
+
+ auto state = IPCThreadState::self();
+ String8 msg;
+ msg.appendFormat("*** Uncaught remote exception! Exceptions are not yet supported "
+ "across processes. Client PID %d UID %d.",
+ state->getCallingPid(), state->getCallingUid());
+ binder_report_exception(env, excep.get(), msg.c_str());
res = JNI_FALSE;
}
@@ -431,6 +435,7 @@ protected:
ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred());
binder_report_exception(env, excep.get(),
"*** Uncaught exception in onBinderStrictModePolicyChange");
+ // TODO: should turn this to fatal?
}
// Need to always call through the native implementation of