summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2018-04-04 11:46:56 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-06-11 22:21:39 +0000
commit9b2d407283f3c62afeccbd6d8e6dcc7824b598c4 (patch)
treefe4081a0bbd50570afdb060c0cda57b68f20a67c
parent94f9bce2e92bd930d3d51548d82ebf7e2cdb8054 (diff)
downloadandroid_frameworks_native-9b2d407283f3c62afeccbd6d8e6dcc7824b598c4.tar.gz
android_frameworks_native-9b2d407283f3c62afeccbd6d8e6dcc7824b598c4.tar.bz2
android_frameworks_native-9b2d407283f3c62afeccbd6d8e6dcc7824b598c4.zip
Don't pad before calling writeInPlace().
writeInplace() itself already pads securely, by masking off the padded bytes. If the padding is done before calling writeInplace(), no mask is applied, and heap data can leak. Bug: 77237570 Test: builds Change-Id: Ide27a0002d4ed4196530430760245b971f6a3f44 Merged-In: Ide27a0002d4ed4196530430760245b971f6a3f44 (cherry picked from commit f8542381b72a7bb2452a5278a00ca8c34edbf8a0) (cherry picked from commit 732132b765cd7b667f16cf32f0fe4c852d7d44dd) Change-Id: I4cf6539e3f39f2e2fa1f30e01bddeb7d3ac8992b
-rw-r--r--libs/binder/Parcel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 3fafbb8d1..460bbe2fc 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -1277,7 +1277,7 @@ status_t Parcel::write(const FlattenableHelperInterface& val)
if (err) return err;
// payload
- void* const buf = this->writeInplace(pad_size(len));
+ void* const buf = this->writeInplace(len);
if (buf == NULL)
return BAD_VALUE;