summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2021-09-27 18:18:35 -0700
committerSteven Moreland <smoreland@google.com>2021-09-27 18:19:44 -0700
commitcaf14b26de53bf39ec2e16d2440dec3a6e32efd1 (patch)
treeca71397b8f57eb07918816a874daef93f63452bb
parent10717131812eaf84724f3dcc50880e38d9e03f59 (diff)
downloadnative-caf14b26de53bf39ec2e16d2440dec3a6e32efd1.tar.gz
libbinder: RPC - better error for malformed parcel
Was making it harder to debug an issue with binder_bpBinderFuzz. Bug: 200368820 Test: binder_bpBinderFuzz Change-Id: I915c04db1b00ed12385e2f6821320166c41febfa
-rw-r--r--libs/binder/RpcState.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp
index df935fe9e3..1e86104392 100644
--- a/libs/binder/RpcState.cpp
+++ b/libs/binder/RpcState.cpp
@@ -427,12 +427,16 @@ status_t RpcState::transact(const sp<RpcSession::RpcConnection>& connection,
const sp<IBinder>& binder, uint32_t code, const Parcel& data,
const sp<RpcSession>& session, Parcel* reply, uint32_t flags) {
if (!data.isForRpc()) {
- ALOGE("Refusing to send RPC with parcel not crafted for RPC");
+ ALOGE("Refusing to send RPC with parcel not crafted for RPC call on binder %p code "
+ "%" PRIu32,
+ binder.get(), code);
return BAD_TYPE;
}
if (data.objectsCount() != 0) {
- ALOGE("Parcel at %p has attached objects but is being used in an RPC call", &data);
+ ALOGE("Parcel at %p has attached objects but is being used in an RPC call on binder %p "
+ "code %" PRIu32,
+ &data, binder.get(), code);
return BAD_TYPE;
}