Merge "binder: race condition by parcel finalize"

This commit is contained in:
Steven Moreland
2021-02-03 18:46:50 +00:00
committed by Gerrit Code Review
4 changed files with 33 additions and 8 deletions

View File

@@ -547,7 +547,8 @@ public final class BinderProxy implements IBinder {
}
try {
return transactNative(code, data, reply, flags);
boolean replyOwnsNative = (reply == null) ? false : reply.ownsNativeParcelObject();
return transactNative(code, data, reply, replyOwnsNative, flags);
} finally {
AppOpsManager.resumeNotedAppOpsCollection(prevCollection);
@@ -572,7 +573,7 @@ public final class BinderProxy implements IBinder {
* Native implementation of transact() for proxies
*/
public native boolean transactNative(int code, Parcel data, Parcel reply,
int flags) throws RemoteException;
boolean replyOwnsNativeParcelObject, int flags) throws RemoteException;
/**
* See {@link IBinder#linkToDeath(DeathRecipient, int)}
*/

View File

@@ -3691,4 +3691,9 @@ public final class Parcel {
public long getBlobAshmemSize() {
return nativeGetBlobAshmemSize(mNativePtr);
}
/** @hide */
/*package*/ boolean ownsNativeParcelObject() {
return mOwnsNativeParcelObject;
}
}