No description
Find a file
Woody Lin 37c82f5c0f Fsync directories before delete key
The boot failure symptom is reproduced on Walleye devices. System boots
up after taking OTA and try to upgrade key, but keymaster returns "failed
to ugprade key". Device reboots to recovery mode because of the failure,
and finally trapped in bootloader screen. Possible scenario is:

(After taking OTA)
vold sends old key and op=UPGRADE to keymaster
keymaster creates and saves new key to RPMB, responses new key to vold
vold saves new key as temp key
vold renames temp key to main key -------------- (1) -- still in cache
vold sends old key and op=DELETE_KEY to keymaster
keymaster removes old key from RPMB ------------ (2) -- write directly to RPMB
==> SYSTEM INTERRUPTED BY CRASH OR SOMETHING; ALL CACHE LOST.
==> System boots up, key in RPMB is deleted but key in storage is old key.

Solution: A Fsync is required between (1) and (2) to cover this case.

Detail analysis: b/124279741#comment21

Bug: 112145641
Bug: 124279741
Test: Insert fault right after deleteKey in vold::begin (KeyStorage.cpp),
      original boot failure symptom is NOT reproducible.
Change-Id: Ib8c349d6d033f86b247f4b35b8354d97cf249d26
2019-03-14 16:48:32 +08:00
bench Abort long-running benchmarks, report progress. 2017-11-07 09:57:12 -07:00
binder/android/os Add vdc checkpoint restoreCheckpointPart 2019-03-07 13:58:49 -08:00
fs Refactor ForkExecvp to improve locking behaviour 2018-12-06 09:37:02 -08:00
model Create new mount directory /mnt/runtime/full. 2019-01-18 23:48:45 +00:00
tests Fix search for values in blkId output 2019-02-05 16:57:40 -08:00
.clang-format Get ourselves some clang-format. 2017-10-18 12:17:36 -06:00
Android.bp Don't unmount /storage for early native processes 2019-03-04 16:22:41 +09:00
AppFuseUtil.cpp Extract AppFuse as a util 2018-11-14 07:28:06 +00:00
AppFuseUtil.h Extract AppFuse as a util 2018-11-14 07:28:06 +00:00
Benchmark.cpp Update vold to log only debug or higher level messages. 2018-09-21 11:16:51 -07:00
Benchmark.h clang-format many files. 2018-09-18 15:41:22 -07:00
BenchmarkGen.h Abort long-running benchmarks, report progress. 2017-11-07 09:57:12 -07:00
CheckEncryption.cpp Test that plaintext can't be read from disk for encrypted files. 2017-10-27 15:14:56 -07:00
CheckEncryption.h Test that plaintext can't be read from disk for encrypted files. 2017-10-27 15:14:56 -07:00
Checkpoint.cpp Make Checkpoint restore resume safe 2019-03-07 13:58:49 -08:00
Checkpoint.h Add vdc checkpoint restoreCheckpointPart 2019-03-07 13:58:49 -08:00
CleanSpec.mk Add an empty CleanSpec.mk 2010-03-08 18:05:25 -08:00
cryptfs.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
cryptfs.h clang-format many files. 2018-09-18 15:41:22 -07:00
Devmapper.cpp Update vold to log only debug or higher level messages. 2018-09-21 11:16:51 -07:00
Devmapper.h clang-format many files. 2018-09-18 15:41:22 -07:00
EncryptInplace.cpp EncryptInplace: Rename variable 2018-12-20 10:38:31 -08:00
EncryptInplace.h Add a mount with metadata encryption service 2018-02-01 10:08:17 -08:00
FileDeviceUtils.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
FileDeviceUtils.h clang-format many files. 2018-09-18 15:41:22 -07:00
FsCrypt.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
FsCrypt.h vold: rename from "ext4 encryption" to fscrypt 2018-10-25 17:12:32 -07:00
IdleMaint.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
IdleMaint.h Add functions to handle idle maintenance 2017-11-14 15:12:30 -08:00
KeyBuffer.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
KeyBuffer.h clang-format many files. 2018-09-18 15:41:22 -07:00
Keymaster.cpp Explain the rationale for not using StrongBox in vold. 2018-05-17 15:24:56 -06:00
Keymaster.h vold: const-ify some of the API 2018-12-20 10:38:15 -08:00
KeyStorage.cpp Fsync directories before delete key 2019-03-14 16:48:32 +08:00
KeyStorage.h vold: Pass std::string by const reference 2018-12-20 10:38:31 -08:00
KeyUtil.cpp Add Support for metadata key with rollback 2018-12-14 14:55:28 -08:00
KeyUtil.h Add Support for metadata key with rollback 2018-12-14 14:55:28 -08:00
Loop.cpp Update vold to log only debug or higher level messages. 2018-09-21 11:16:51 -07:00
Loop.h clang-format many files. 2018-09-18 15:41:22 -07:00
main.cpp Enable metadata encryption for userdata_gsi. 2019-02-14 08:29:26 -08:00
MetadataCrypt.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
MetadataCrypt.h vold: rename from "ext4 encryption" to fscrypt 2018-10-25 17:12:32 -07:00
MoveStorage.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
MoveStorage.h clang-format many files. 2018-09-18 15:41:22 -07:00
NetlinkHandler.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
NetlinkHandler.h clang-format many files. 2018-09-18 15:41:22 -07:00
NetlinkManager.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
NetlinkManager.h clang-format many files. 2018-09-18 15:41:22 -07:00
OWNERS Add OWNERS in system/vold 2017-06-09 14:55:46 -07:00
PREUPLOAD.cfg vold should be fully developed in AOSP. 2018-09-11 12:08:43 -06:00
Process.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
Process.h Move to modern utility methods from android::base. 2017-10-17 12:40:51 -06:00
ScryptParameters.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
ScryptParameters.h clang-format many files. 2018-09-18 15:41:22 -07:00
secdiscard.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
sehandle.h clang-format many files. 2018-09-18 15:41:22 -07:00
Utils.cpp Fix search for values in blkId output 2019-02-05 16:57:40 -08:00
Utils.h Add UnmountTreeWithPrefix util method. 2019-01-17 01:42:48 -08:00
vdc.cpp Add vdc checkpoint restoreCheckpointPart 2019-03-07 13:58:49 -08:00
vdc.rc Remove all references to FDE enable wipe 2017-12-22 11:17:15 -08:00
vold.rc vold: Grant root group 2018-08-08 17:08:02 -07:00
vold_prepare_subdirs.cpp Create subdirs in system_ce/ for multi-user backup 2019-01-17 12:53:16 +00:00
VoldNativeService.cpp Add vdc checkpoint restoreCheckpointPart 2019-03-07 13:58:49 -08:00
VoldNativeService.h Add vdc checkpoint restoreCheckpointPart 2019-03-07 13:58:49 -08:00
VoldUtil.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
VoldUtil.h Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
VolumeManager.cpp Don't unmount /storage for early native processes 2019-03-04 16:22:41 +09:00
VolumeManager.h vold: const-ify some of the API 2018-12-20 10:38:15 -08:00
wait_for_keymaster.cpp add wait_for_keymaster 2018-05-09 12:59:18 -07:00
wait_for_keymaster.rc Add rc file for wait_for_keymaster 2018-05-15 16:15:21 -07:00