summaryrefslogtreecommitdiff
path: root/libs/binder/IPCThreadState.cpp
diff options
context:
space:
mode:
author Hang Lu <quic_hangl@quicinc.com> 2021-03-24 13:17:22 +0800
committer Hang Lu <quic_hangl@quicinc.com> 2021-04-17 17:13:27 +0800
commitb185ac061645654f330543e6053dab2d77191747 (patch)
tree1be329ab01f877d26fffa44a814d91807fb01d53 /libs/binder/IPCThreadState.cpp
parent611202f9b70c3953189354ef9c8fac2ecdab4aff (diff)
libbinder: support BR_ONEWAY_SPAM_SUSPECT
This command tells userspace to dump current stack, which happened when oneway spamming is detected in kernel. And also add an ioctl command BINDER_ENABLE_ONEWAY_SPAM_DETECTION to enable/disable this feature per-proc. Bug: 181190340 Change-Id: I7afb1df46a4fbf59bc69b56649aa3ee779dfea5a
Diffstat (limited to 'libs/binder/IPCThreadState.cpp')
-rw-r--r--libs/binder/IPCThreadState.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index 406bd54e6f..6fb1227f63 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -90,6 +90,8 @@ static const char *kReturnStrings[] = {
"BR_DEAD_BINDER",
"BR_CLEAR_DEATH_NOTIFICATION_DONE",
"BR_FAILED_REPLY",
+ "BR_FROZEN_REPLY",
+ "BR_ONEWAY_SPAM_SUSPECT",
"BR_TRANSACTION_SEC_CTX",
};
@@ -894,6 +896,11 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult)
}
switch (cmd) {
+ case BR_ONEWAY_SPAM_SUSPECT:
+ ALOGE("Process seems to be sending too many oneway calls.");
+ CallStack::logStack("oneway spamming", CallStack::getCurrent().get(),
+ ANDROID_LOG_ERROR);
+ [[fallthrough]];
case BR_TRANSACTION_COMPLETE:
if (!reply && !acquireResult) goto finish;
break;