No description
Find a file
Eric Biggers 2d30b890d2 KeyStorage: don't request rollback resistance for wrapped storage keys
Hardware-wrapped inline encryption keys (a.k.a. "wrapped storage keys"
or "TAG_STORAGE_KEY keys") are being generated with rollback resistance
enabled, but are never deleted.  This leaks the space that KeyMint
implementations reserve for rollback-resistant keys, e.g. space in the
RPMB.  This is a problem especially for the per-boot key, as that gets
regenerated every time the device is rebooted.  After enough reboots,
KeyMint runs out of space for rollback-resistant keys.  This stops any
new or upgraded keys from being rollback-resistant, reducing security.

This bug affects all devices that use HW-wrapped inline encryption keys
for FBE (have "wrappedkey_v0" in the options for fileencryption in their
fstab), and whose KeyMint implementations support TAG_STORAGE_KEY in
combination with TAG_ROLLBACK_RESISTANCE.  But it's more of a problem on
devices that are rebooted frequently, as per the above.

Fix this bug by not requesting rollback resistance for HW-wrapped inline
encryption keys.  It was a mistake for these keys to ever be rollback-
resistant, as they are simply a stand-in for raw keys.  Secure deletion
instead has to happen higher up the stack, via the Keystore key that
encrypts these keys being deleted, or via the Keystore key and/or Weaver
slot needed to decrypt the user's synthetic password being deleted.

(It was also a mistake for HW-wrapped inline encryption keys to use
Keystore at all.  The revised design for them that I'm working on for
upstream Linux doesn't use Keystore.  But for now, Android uses Keystore
for them, and the fix is to not request rollback resistance.)

Bug: 240533602
Fixes: 3dfb094cb2 ("vold: Support Storage keys for FBE")
Change-Id: I648a1af9e16787dfcfeefa2b2f2e4a72cac2c6a6
2022-07-28 18:48:46 +00:00
bench [LSC] Add LOCAL_LICENSE_KINDS to system/vold 2021-02-14 10:37:25 -08:00
binder/android/os Introduce target dirty segment ratio tunable parameter 2022-07-04 21:23:46 +00:00
fs Rename fscrypt_is_native() to IsFbeEnabled() 2022-06-15 18:52:18 +00:00
model Create misc_ce and misc_de directories on /mnt/expand 2022-03-18 11:11:22 +00:00
tests Remove most of FDE support 2021-11-09 16:09:33 -08:00
.clang-format vold: use system-clang-format 2019-09-16 12:00:40 -07:00
Android.bp Rename fuse_media.o to fuseMedia.o 2022-07-12 05:38:39 +00:00
AppFuseUtil.cpp AppFuseUtil: Call ForceUnmount before PrepareDir. 2019-04-09 18:45:32 +01:00
AppFuseUtil.h Extract AppFuse as a util 2018-11-14 07:28:06 +00:00
Benchmark.cpp vold: Use Wakelock::tryGet() 2021-02-22 17:24:51 -05: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
Checkpoint.cpp Convert vold to new BootControl client 2022-06-22 15:14:55 -07:00
Checkpoint.h Add an isCheckpointing() binder call for adb remount. 2020-06-10 23:52:25 -07:00
CleanSpec.mk Add an empty CleanSpec.mk 2010-03-08 18:05:25 -08:00
cryptfs.cpp Rename fscrypt_is_native() to IsFbeEnabled() 2022-06-15 18:52:18 +00:00
cryptfs.h Remove CRYPT_FOOTER_OFFSET 2021-11-10 14:03:48 -08:00
CryptoType.cpp Generalize CryptoType infrastructure 2020-02-14 00:48:27 -08:00
CryptoType.h Generalize CryptoType infrastructure 2020-02-14 00:48:27 -08:00
EncryptInplace.cpp Remove progress property support from encrypt_inplace() 2022-03-09 21:03:52 +00:00
EncryptInplace.h Remove progress property support from encrypt_inplace() 2022-03-09 21:03:52 +00:00
FileDeviceUtils.cpp Remove excess logging in secdiscard 2019-03-21 19:13:51 +00:00
FileDeviceUtils.h clang-format many files. 2018-09-18 15:41:22 -07:00
FsCrypt.cpp Rename fscrypt_is_native() to IsFbeEnabled() 2022-06-15 18:52:18 +00:00
FsCrypt.h Increase early boot logging to kernel log 2022-03-22 00:33:52 +00:00
IdleMaint.cpp Introduce target dirty segment ratio tunable parameter 2022-07-04 21:23:46 +00:00
IdleMaint.h Introduce target dirty segment ratio tunable parameter 2022-07-04 21:23:46 +00: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
KeyStorage.cpp KeyStorage: don't request rollback resistance for wrapped storage keys 2022-07-28 18:48:46 +00:00
KeyStorage.h Replace most references to Keymaster with Keystore 2021-06-15 12:07:15 -07:00
Keystore.cpp Replace an outdated TODO in Keystore::exportKey 2022-03-17 22:39:19 +00:00
Keystore.h Detect factory reset and deleteAllKeys 2021-08-11 10:29:59 -07:00
KeyUtil.cpp Improve vold logging. 2021-11-08 13:22:53 -08:00
KeyUtil.h No using inside header files 2021-06-15 15:20:44 -07:00
Loop.cpp Remove vold logs related to block devices 2021-07-28 02:58:57 +01:00
Loop.h clang-format many files. 2018-09-18 15:41:22 -07:00
main.cpp Increase early boot logging to kernel log 2022-03-22 00:33:52 +00:00
MetadataCrypt.cpp Support zoned device with dm-default-key 2022-06-07 18:43:54 -07:00
MetadataCrypt.h Support zoned device with dm-default-key 2022-06-07 18:43:54 -07:00
MoveStorage.cpp vold: Use Wakelock::tryGet() 2021-02-22 17:24:51 -05:00
MoveStorage.h clang-format many files. 2018-09-18 15:41:22 -07:00
NetlinkHandler.cpp vold: remove unused stop() methods 2020-09-23 10:02:25 -07:00
NetlinkHandler.h vold: remove unused stop() methods 2020-09-23 10:02:25 -07:00
NetlinkManager.cpp vold: remove unused stop() methods 2020-09-23 10:02:25 -07:00
NetlinkManager.h vold: remove unused stop() methods 2020-09-23 10:02:25 -07:00
OWNERS OWNERS: add alan and jeff, alphabetize 2020-12-10 13:08:28 +01:00
PREUPLOAD.cfg vold should be fully developed in AOSP. 2018-09-11 12:08:43 -06:00
Process.cpp Show names of processes killed by KillProcessesWithOpenFiles() 2021-05-10 17:34:11 +00:00
Process.h Only kill apps with storage app data isolation enabled 2021-04-30 13:58:07 +00:00
secdiscard.cpp secdiscard: use F2FS_IOC_SEC_TRIM_FILE for secure discard 2020-09-14 08:43:15 +09:00
sehandle.h clang-format many files. 2018-09-18 15:41:22 -07:00
TEST_MAPPING Add vold to hwasan-postsubmit 2022-03-18 14:25:02 -07:00
Utils.cpp Prepare /data/user/0 and /data/media/obb during initUser0 2022-05-11 21:56:01 +00:00
Utils.h Prepare /data/user/0 and /data/media/obb during initUser0 2022-05-11 21:56:01 +00:00
vdc.cpp Support zoned device with dm-default-key 2022-06-07 18:43:54 -07:00
vold.rc vold: Reboot if vold failure 2021-10-06 18:47:37 +00:00
vold_prepare_subdirs.cpp Create misc_ce and misc_de directories on /mnt/expand 2022-03-18 11:11:22 +00:00
VoldNativeService.cpp Introduce target dirty segment ratio tunable parameter 2022-07-04 21:23:46 +00:00
VoldNativeService.h Introduce target dirty segment ratio tunable parameter 2022-07-04 21:23:46 +00:00
VoldNativeServiceValidation.cpp [vold] Check incremental paths before mounting 2022-01-31 22:13:14 +00:00
VoldNativeServiceValidation.h [vold] Check incremental paths before mounting 2022-01-31 22:13:14 +00:00
VoldUtil.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
VoldUtil.h Remove unused code in VoldUtil.h 2020-02-18 10:48:16 -08:00
VolumeManager.cpp Rename fscrypt_is_native() to IsFbeEnabled() 2022-06-15 18:52:18 +00:00
VolumeManager.h Remove broken code for mounting encrypted OBB files 2022-03-01 21:19:18 +00:00