summaryrefslogtreecommitdiff
path: root/libutils/String16_fuzz.cpp
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2021-02-26 13:34:35 -0800
committerDavid Anderson <dvander@google.com>2021-02-26 17:28:06 -0800
commit2a55e81166a3c6ce6cfcd0e291af538ce952ffc4 (patch)
treed8f4b8b4a6634c525dd1fc9909a812bdfd5212a9 /libutils/String16_fuzz.cpp
parent4e936b4b6e9cb5aa5f5a6c9fa5ec184ad72ea6dc (diff)
libsnapshot: Harden merge-in-recovery for factory data resets.
This addresses bugs where unexpected edge cases in the snapshot state could prevent a merge or data wipe from completing in recovery. Invalid snapshots (eg on the wrong slot) are now ignored in CheckMergeState(). This prevents those snapshots from being detected as "cancelled" and thus falling into RemoveAllUpdateState. ProcessUpdateState will no longer call RemoveAllUpdateState in recovery. Furthermore, when RemoveAllUpdateState fails, we will no longer return the "old" state. If this state is Merging, ProcessUpdateState can infinite loop. Finally, HandleImminentDataWipe now guarantees the final state will be either MergeFailed or None. For testing purposes, the old mechanism was too susceptible to state machinery changes. And for practical purposes, either we're going to wipe data (which removes the OTA), or a merge failed and we can't. So the effective outcome is always no update or a failed update. Bug: 179006671 Test: vts_libsnapshot_test Change-Id: Idcb30151e4d35cbeccf14369f09707ae94a57c66
Diffstat (limited to 'libutils/String16_fuzz.cpp')
0 files changed, 0 insertions, 0 deletions