diff options
author | Hugo Benichi <hugobenichi@google.com> | 2016-06-21 09:48:07 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2016-07-12 21:56:40 +0900 |
commit | 5224f00b5110e37a288692a3449387aa199a1fc3 (patch) | |
tree | b9d70ffd007e07b3a52c3703b5549a68ccc4eba3 /cmds/app_process/app_main.cpp | |
parent | 9a3fbe116209a6d44a5f9672a3a249cb8932e3d2 (diff) |
Fix unsafe concurrent access in LegacyTypeTracker
This patch adds synchronization inside LegacyTypeTracker so that
getNetworkForType() can safely run concurrently with remove().
Without synchronization if remove() removes the last network for a
given type while getNetworkForType() runs for the same type, it is
possible that getNetworkForType tries to access the head of an empty
list, resulting in a runtime exception.
This issue was found by zoran.jovanovic@sonymobile.com who proposed a
fix in AOSP (Change-Id: Ia963662edb9d643790e8d9439e4dbdcac4c2187b).
This patch differs from the fix proposed by the bug reporter and tries
instead to do the minimum amount of locking to make getNetworkForType
safe.
Bug: 29030387
(cherry picked from commit 78caa25870391f676e1edbd448b5ff3e12a99a1e)
Change-Id: I915aac527fc8828b32bf35fee870add2dfb11d8d
Diffstat (limited to 'cmds/app_process/app_main.cpp')
0 files changed, 0 insertions, 0 deletions