summaryrefslogtreecommitdiff
path: root/libs/androidfw/FileStream.cpp
diff options
context:
space:
mode:
author Achim Thesmann <achim@google.com> 2023-06-08 22:16:09 +0000
committer Achim Thesmann <achim@google.com> 2023-06-08 22:56:32 +0000
commit11abd636cd0f7b6a133cf6e42ffed913d7b29e80 (patch)
treec7c4b699cf9ff51a9fe1e22425e5c3418c740e39 /libs/androidfw/FileStream.cpp
parentfa05c1b9b17e722652a5430428af097f1807b319 (diff)
Prevent race condition
There is a chance that the service record loses its ability to start background activities (BAL) between the evaluation of the if condition and computing the token used to update the process record. This results in system server crashing for a failed precondition (expecting BAL allowed, but actually forbidden by the passed in privileges). With the change there is almost no penalty in calculating the token every time (it might actually be faster as we can now skip evaluating the logic a second time) and it is guaranteed to be consistent. Since the logic is otherwise not changes there is no risk in doing this change. Test: atest BackgroundActivityLaunchTest Bug: 285979934 Change-Id: Ia480ef68dfaf34dccea6f24cf34ced15e1434cc3
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions