Skip to content

Commit 3b685aa

Browse files
author
Steven Moreland
committed
libbinder: better object logs
Separate patch, b/c won't be backported Bug: 370840874 Test: N/A Ignore-AOSP-First: security related Change-Id: Iefc49398bab70e7255346dd4a0375b11edc1c159
1 parent ff7e454 commit 3b685aa

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

libs/binder/Parcel.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static void acquire_object(const sp<ProcessState>& proc, const flat_binder_objec
180180
}
181181
}
182182

183-
ALOGD("Invalid object type 0x%08x", obj.hdr.type);
183+
ALOGE("Invalid object type 0x%08x to acquire", obj.hdr.type);
184184
}
185185

186186
static void release_object(const sp<ProcessState>& proc, const flat_binder_object& obj,
@@ -210,7 +210,7 @@ static void release_object(const sp<ProcessState>& proc, const flat_binder_objec
210210
}
211211
}
212212

213-
ALOGE("Invalid object type 0x%08x", obj.hdr.type);
213+
ALOGE("Invalid object type 0x%08x to release", obj.hdr.type);
214214
}
215215
#endif // BINDER_WITH_KERNEL_IPC
216216

@@ -1874,7 +1874,10 @@ status_t Parcel::validateReadData(size_t upperBound) const
18741874
if (mDataPos < kernelFields->mObjects[nextObject] + sizeof(flat_binder_object)) {
18751875
// Requested info overlaps with an object
18761876
if (!mServiceFuzzing) {
1877-
ALOGE("Attempt to read from protected data in Parcel %p", this);
1877+
ALOGE("Attempt to read or write from protected data in Parcel %p. pos: "
1878+
"%zu, nextObject: %zu, object offset: %llu, object size: %zu",
1879+
this, mDataPos, nextObject, kernelFields->mObjects[nextObject],
1880+
sizeof(flat_binder_object));
18781881
}
18791882
return PERMISSION_DENIED;
18801883
}

0 commit comments

Comments
 (0)