summaryrefslogtreecommitdiff
path: root/wifi/java/src
diff options
context:
space:
mode:
author Hani Kazmi <hanikazmi@google.com> 2023-03-17 14:34:56 +0000
committer Hani Kazmi <hanikazmi@google.com> 2023-03-17 14:50:05 +0000
commitab4e67c2f0a1c80d1bcc2c729945bbd11fbb0fc8 (patch)
tree8447de3ee1bff484b7b5ffbc1349acf1accc0461 /wifi/java/src
parentaa24b1bdc5ef790a17ad10957ded596fe03e4c4c (diff)
Synchronize on parcel for LazyValue methods
With the changes introduced in ag/18795008, the parcel underlying a Bundle's LazyValues is recycled once all the LazyValues have been unwrapped. This has introduced a new race condition. If a key with an wrapped LazyValue is accessed (in thread A), while simultaneously a different thread (B) writes the bundle to a Parcel, B may check the parcel is unrecycled before A finishes unwrapping it, then try to copy the parcel after it is recycled by A. To avoid this, we now synchronize on the parcel in all methods where it's contents need to be accessed after the initial check. Bug: 267096262 Test: Debugged with break points in critical section to reproduce before and after fix Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest Change-Id: I055d31892e46574b9e450ece7f5042a9eb185c40
Diffstat (limited to 'wifi/java/src')
0 files changed, 0 insertions, 0 deletions