diff options
author | 2022-03-03 17:02:23 +0000 | |
---|---|---|
committer | 2022-03-03 17:02:23 +0000 | |
commit | 27dbab9bc78fdae8b43d25609553bde16f07fd4a (patch) | |
tree | e3ae7f65ef8406a7534f49571f5a7c621db4dc68 | |
parent | 1077ad7fe5a1fc7d5323a049b4e8935f60329457 (diff) | |
parent | 4e82c4a80faaae99ec5458a06c0d883a29f160ea (diff) |
Merge "libbinder: avoid ACCEPT_FDS on proxies" am: c7d0e95a54 am: 7d8a8f1733 am: 4e82c4a80f
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2003198
Change-Id: I44e553086440e32c09069c245294982becb4cc11
-rw-r--r-- | libs/binder/Parcel.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index f84f639d2c..6a138e340f 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -200,7 +200,6 @@ status_t Parcel::flattenBinder(const sp<IBinder>& binder) { } flat_binder_object obj; - obj.flags = FLAT_BINDER_FLAG_ACCEPTS_FDS; int schedBits = 0; if (!IPCThreadState::self()->backgroundSchedulingDisabled()) { @@ -221,6 +220,7 @@ status_t Parcel::flattenBinder(const sp<IBinder>& binder) { const int32_t handle = proxy ? proxy->getPrivateAccessor().binderHandle() : 0; obj.hdr.type = BINDER_TYPE_HANDLE; obj.binder = 0; /* Don't pass uninitialized stack data to a remote process */ + obj.flags = 0; obj.handle = handle; obj.cookie = 0; } else { @@ -231,6 +231,7 @@ status_t Parcel::flattenBinder(const sp<IBinder>& binder) { // override value, since it is set explicitly schedBits = schedPolicyMask(policy, priority); } + obj.flags = FLAT_BINDER_FLAG_ACCEPTS_FDS; if (local->isRequestingSid()) { obj.flags |= FLAT_BINDER_FLAG_TXN_SECURITY_CTX; } @@ -243,6 +244,7 @@ status_t Parcel::flattenBinder(const sp<IBinder>& binder) { } } else { obj.hdr.type = BINDER_TYPE_BINDER; + obj.flags = 0; obj.binder = 0; obj.cookie = 0; } |