No description
Find a file
Woody Lin a598e04a91 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: Ia042b23699c37c94758fb660aecec64d39f39738
Merged-In: Ib8c349d6d033f86b247f4b35b8354d97cf249d26
2019-03-14 10:29:42 -05:00
bench Abort long-running benchmarks, report progress. 2017-11-07 09:57:12 -07:00
binder/android/os Remove secdiscard IPC call 2018-03-05 13:55:23 +00:00
fs vold: set f2fs feature bit 2018-04-06 11:54:31 -07:00
model vold: meta encryption: fix /dev/block/by-name/userdata to dm-3 2018-07-29 18:22:47 -07:00
tests Fix warning in system/vold/tests. 2017-12-07 14:18:34 -08:00
.clang-format Get ourselves some clang-format. 2017-10-18 12:17:36 -06:00
Android.bp Add rc file for wait_for_keymaster 2018-05-15 16:15:21 -07:00
Benchmark.cpp Abort long-running benchmarks, report progress. 2017-11-07 09:57:12 -07:00
Benchmark.h Fix task memory leaks; better path validation. 2017-10-18 11:44:57 -06: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
CleanSpec.mk Add an empty CleanSpec.mk 2010-03-08 18:05:25 -08:00
cryptfs.cpp Merge "[DO NOT MERGE] Fix signedness mismatch and integer underflow" into oc-dev am: 92e63e3f9b 2018-10-11 16:16:03 -07:00
cryptfs.h cryptfs: Require ext disk crypt to match code 2018-02-16 15:23:56 -08:00
Devmapper.cpp Move to modern utility methods from android::base. 2017-10-17 12:40:51 -06:00
Devmapper.h Move to modern utility methods from android::base. 2017-10-17 12:40:51 -06:00
EncryptInplace.cpp Add a mount with metadata encryption service 2018-02-01 10:08:17 -08:00
EncryptInplace.h Add a mount with metadata encryption service 2018-02-01 10:08:17 -08:00
Ext4Crypt.cpp Fsync directories after creating files 2019-03-14 10:26:21 -05:00
Ext4Crypt.h Remove secdiscard IPC call 2018-03-05 13:55:23 +00:00
FileDeviceUtils.cpp Move functions useful for crypto test into their own file 2017-06-16 16:17:26 -07:00
FileDeviceUtils.h Move functions useful for crypto test into their own file 2017-06-16 16:17:26 -07:00
hash.h vold: Bugfixes & cleanups 2010-03-13 16:42:19 -08:00
IdleMaint.cpp vold: meta encryption: fix /dev/block/by-name/userdata to dm-3 2018-07-29 18:22:47 -07:00
IdleMaint.h Add functions to handle idle maintenance 2017-11-14 15:12:30 -08:00
KeyBuffer.cpp Zero memory used for encryuption keys. 2017-08-10 17:31:03 +01:00
KeyBuffer.h Zero memory used for encryuption keys. 2017-08-10 17:31:03 +01:00
Keymaster.cpp Explain the rationale for not using StrongBox in vold. 2018-05-17 15:24:56 -06:00
Keymaster.h Do Keymaster HMAC key agreement in vold. 2018-05-09 15:14:34 -06:00
KeyStorage.cpp Fsync directories before delete key 2019-03-14 10:29:42 -05:00
KeyStorage.h When we forget a volume, forget per-volume key 2017-10-26 12:19:09 -07:00
KeyUtil.cpp When we forget a volume, forget per-volume key 2017-10-26 12:19:09 -07:00
KeyUtil.h When we forget a volume, forget per-volume key 2017-10-26 12:19:09 -07:00
Loop.cpp Use unique_ptr<DIR> to safely release resources. 2018-02-24 18:09:22 -07:00
Loop.h Move to modern utility methods from android::base. 2017-10-17 12:40:51 -06:00
main.cpp Add a mount with metadata encryption service 2018-02-01 10:08:17 -08:00
MetadataCrypt.cpp Fix spurious error 2018-05-10 15:19:15 -07:00
MetadataCrypt.h Add a mount with metadata encryption service 2018-02-01 10:08:17 -08:00
MoveStorage.cpp FBE devices now fully support adoptable storage. 2018-01-04 18:52:07 -07:00
MoveStorage.h Fix task memory leaks; better path validation. 2017-10-18 11:44:57 -06:00
NetlinkHandler.cpp Move to modern utility methods from android::base. 2017-10-17 12:40:51 -06:00
NetlinkHandler.h Fix google-explicit-constructor warnings in system/vold. 2016-08-02 11:41:54 -07:00
NetlinkManager.cpp Move to modern utility methods from android::base. 2017-10-17 12:40:51 -06:00
NetlinkManager.h system: vold2: Initial skeleton for vold2. 2009-10-10 17:57:51 -07:00
OWNERS Add OWNERS in system/vold 2017-06-09 14:55:46 -07:00
PREUPLOAD.cfg Get ourselves some clang-format. 2017-10-18 12:17:36 -06:00
Process.cpp StartsWith now allows std::string prefixes. 2017-12-20 12:38:47 -08:00
Process.h Move to modern utility methods from android::base. 2017-10-17 12:40:51 -06:00
ScryptParameters.cpp system/vold: cleanup compiler warnings (read of uninitialized memory). 2016-10-19 17:58:32 -07:00
ScryptParameters.h Be more C++. volume UUID should always be std::string. 2017-10-09 13:36:35 -07:00
secdiscard.cpp Move functions useful for crypto test into their own file 2017-06-16 16:17:26 -07:00
secontext.cpp cryptfs: run e2fsck/fsck.f2fs in fsck domain 2016-02-01 12:59:59 -08:00
secontext.h Be more C++. volume UUID should always be std::string. 2017-10-09 13:36:35 -07:00
sehandle.h Set SELinux contexts on device nodes created by vold. 2014-09-30 15:35:28 -04:00
Utils.cpp Fsync directories after creating files 2019-03-14 10:26:21 -05:00
Utils.h Fsync directories after creating files 2019-03-14 10:26:21 -05:00
vdc.cpp Add a mount with metadata encryption service 2018-02-01 10:08:17 -08:00
vdc.rc Remove all references to FDE enable wipe 2017-12-22 11:17:15 -08:00
vold.rc Grant "disk_reserved" GID to critical services. 2018-01-07 19:30:19 -07:00
vold_prepare_subdirs.cpp Fingerprint data is now stored in one of two ways depending on the 2018-01-23 14:34:55 -08:00
VoldNativeService.cpp Remove secdiscard IPC call 2018-03-05 13:55:23 +00:00
VoldNativeService.h Remove secdiscard IPC call 2018-03-05 13:55:23 +00:00
VoldUtil.cpp Refactor of use of fstab in advance of fix. 2017-09-26 14:21:10 -07:00
VoldUtil.h Refactor of use of fstab in advance of fix. 2017-09-26 14:21:10 -07:00
VolumeManager.cpp Exclude /mnt/vendor from vold's ownership. 2018-04-16 14:33:53 -07:00
VolumeManager.h Delay touching disks when secure keyguard showing. 2017-12-15 13:44:55 -07: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