Commit graph

4257 commits

Author SHA1 Message Date
Eric Biggers
c1c68dede3 Merge "EncryptInplace: fsync cryptofd before reporting success" am: e244a15f34 am: 22f226245a am: 420868767f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1488376

Change-Id: If74875c79d3f4c68895d35f2138e42ec9f355afc
2020-11-05 19:50:13 +00:00
Eric Biggers
420868767f Merge "EncryptInplace: fsync cryptofd before reporting success" am: e244a15f34 am: 22f226245a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1488376

Change-Id: I8e7152cce18b1ed8b5f1265c08e2abb403deef9c
2020-11-05 19:23:28 +00:00
Eric Biggers
22f226245a Merge "EncryptInplace: fsync cryptofd before reporting success" am: e244a15f34
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1488376

Change-Id: I10ff2f5cccf00fbd3cbac93059ce7f069911e9c4
2020-11-05 19:09:37 +00:00
Eric Biggers
e244a15f34 Merge "EncryptInplace: fsync cryptofd before reporting success" 2020-11-05 18:51:13 +00:00
Eric Biggers
e4bf57a6d3 [automerger skipped] KeyUtil: don't use keepOld=true for system DE and volume keys am: 2c9d6d6675 -s ours
am skip reason: Change-Id I42d3f5fbe32cb2ec229f4b614cfb271412a3ed29 with SHA-1 c493903732 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/vold/+/12971598

Change-Id: Ieb69946c8c2a6640b7af58561d872b50022d4f5b
2020-11-05 17:50:20 +00:00
Eric Biggers
1ba8865fec EncryptInplace: fsync cryptofd before reporting success
fsync() the cryptofd when done writing to it.  Without this, any
remaining dirty pages in the crypto_blkdev's page cache (which there
might be a lot of, even as much as all the data that was written) won't
be flushed to disk until the cryptofd is closed, which ignores I/O
errors and is also after we already reported 100% completion.

There wasn't an fsync() in the original version either, so we've been
getting by without it, but it seems it should be there.

Change-Id: Idd1be3ae67ce96ecf3946b9efb9fc57414f5805a
2020-11-04 19:24:19 -08:00
Eric Biggers
0b705b5167 Merge changes from topic "encryptinplace-cleanup" am: 91e4f1dd76 am: ee175c954a am: 992e8dfdaa
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1467990

Change-Id: Ic3f7333839a1aceffff621ec8f592b744778cdef
2020-11-04 20:23:01 +00:00
Eric Biggers
992e8dfdaa Merge changes from topic "encryptinplace-cleanup" am: 91e4f1dd76 am: ee175c954a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1467990

Change-Id: If0f5196b66387b3a195b10c1b48d030f7bb8eb5a
2020-11-04 19:53:11 +00:00
Eric Biggers
ee175c954a Merge changes from topic "encryptinplace-cleanup" am: 91e4f1dd76
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1467990

Change-Id: I50e47bd1cb102b9013542b0676258a79ac44b6b1
2020-11-04 19:15:05 +00:00
Eric Biggers
91e4f1dd76 Merge changes from topic "encryptinplace-cleanup"
* changes:
  Refactor EncryptInplace.cpp
  Correctly calculate tot_used_blocks on ext4 with uninit_bg
  Fix memory leak of f2fs_info
  Remove special handling for missing crypto_blkdev
  Check return value of create_crypto_blk_dev()
  Remove unused support for partial encryption
2020-11-04 18:47:05 +00:00
Eric Biggers
f038c5f5e1 Refactor EncryptInplace.cpp
Refactor EncryptInplace.cpp to simplify and improve it a lot.  This is
everything that didn't fit into prior commits, including:

- Share a lot more code between ext4, f2fs, and full encryption.

- Improve the log messages.  Most importantly, don't spam the log with
  huge numbers of messages, and don't log errors in expected cases.
  Note: generate_f2fs_info() is still too noisy, but that's part of
  "system/extras", not vold, so this change doesn't change that.

- When possible, do 32K reads/writes for f2fs and for full encryption,
  not just for ext4.  This might improve performance.

- Take advantage of C++ functionality.

- Be more careful about edge cases.  E.g. if the calculation of the
  number of blocks to encrypt was wrong, don't set vold.encrypt_progress
  to > 99 until we're actually done.

The net change is over 200 lines removed.

Before-after comparison of log when enabling metadata encryption:

ext4 before:
    I vold    : Beginning inplace encryption, nr_sec: 16777216
    D vold    : cryptfs_enable_inplace(/dev/block/dm-8, /dev/block/by-name/userdata, 16777216, 0)
    D vold    : Opening/dev/block/by-name/userdata
    D vold    : Opening/dev/block/dm-8
    I vold    : Encrypting ext4 filesystem in place...
    [omitted 6387 log messages]
    I vold    : Encrypted to sector 822084608
    D vold    : cryptfs_enable_inplace_ext4 success
    I vold    : Inplace encryption complete

ext4 after:
    D vold    : encrypt_inplace(/dev/block/dm-8, /dev/block/by-name/userdata, 16777216, false)
    D vold    : ext4 filesystem has 64 block groups
    I vold    : Encrypting ext4 filesystem on /dev/block/by-name/userdata in-place via /dev/block/dm-8
    I vold    : 50327 blocks (206 MB) of 2097152 blocks are in-use
    D vold    : Encrypted 10000 of 50327 blocks
    D vold    : Encrypted 20000 of 50327 blocks
    D vold    : Encrypted 30000 of 50327 blocks
    D vold    : Encrypted 40000 of 50327 blocks
    D vold    : Encrypted 50000 of 50327 blocks
    D vold    : Encrypted 50327 of 50327 blocks
    I vold    : Successfully encrypted ext4 filesystem on /dev/block/by-name/userdata

f2fs before:
    I vold    : Beginning inplace encryption, nr_sec: 16777216
    D vold    : cryptfs_enable_inplace(/dev/block/dm-8, /dev/block/by-name/userdata, 16777216, 0)
    D vold    : Opening/dev/block/by-name/userdata
    D vold    : Opening/dev/block/dm-8
    E vold    : Reading ext4 extent caused an exception
    D vold    : cryptfs_enable_inplace_ext4()=-1
    [omitted logspam from f2fs_sparseblock]
    I vold    : Encrypting from block 0
    I vold    : Encrypted to block 15872
    I vold    : Encrypting from block 16384
    I vold    : Encrypted to block 16385
    I vold    : Encrypting from block 17408
    I vold    : Encrypted to block 17412
    D vold    : cryptfs_enable_inplace_f2fs success
    I vold    : Inplace encryption complete

f2fs after:
    D vold    : encrypt_inplace(/dev/block/dm-8, /dev/block/by-name/userdata, 16777216, false)
    [omitted logspam from f2fs_sparseblock]
    I vold    : Encrypting f2fs filesystem on /dev/block/by-name/userdata in-place via /dev/block/dm-8
    I vold    : 15880 blocks (65 MB) of 2097152 blocks are in-use
    D vold    : Encrypted 10000 of 15880 blocks
    D vold    : Encrypted 15880 of 15880 blocks
    I vold    : Successfully encrypted f2fs filesystem on /dev/block/by-name/userdata

Test: Booted Cuttlefish with metadata encryption enabled and with the
      userdata filesystem using (1) ext4, (2) f2fs, and (3) f2fs but
      with EncryptInplace.cpp patched to not recognize the filesystem
      and fall back to the "full" encryption case.  Checked that the log
      messages were as expected and that /data was mounted.

      I've had no luck testing FDE yet; it doesn't work even without
      these changes.  Suggestions appreciated...

Change-Id: I08fc8465f7962abd698904b5466f3ed080d53953
2020-11-03 14:16:32 -08:00
Eric Biggers
7e70d6939d Correctly calculate tot_used_blocks on ext4 with uninit_bg
The calculated number of blocks to encrypt is too high on ext4
filesystems that have the uninit_bg feature.  This is because the
calculation assumes that all blocks not counted in bg_free_blocks_count
need to encrypted.  But actually, uninitialized block groups have inode
blocks which vold doesn't encrypt since they are uninitialized, but they
are "allocated" and thus reduce bg_free_blocks_count.

Therefore, add a helper function num_base_meta_blocks_in_group() which
returns the number of blocks to encrypt in an uninitialized block group.
Use it both for the encryption and for calculating 'tot_used_blocks'.

Also compute 'tot_used_blocks' additively rather than subtractively, as
this is easier to understand.

Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: I4d2cb40291da67dd1bafd61289ccb9e6343bfda3
2020-11-03 14:11:01 -08:00
Eric Biggers
b3ba087d9c Fix memory leak of f2fs_info
'struct f2fs_info' from system/extras/f2fs_utils is supposed to be
freed using free_f2fs_info(), not just free().

Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: If6e75e5c604b40be24538b156a37cc76f4f0d4f7
2020-11-03 14:11:01 -08:00
Eric Biggers
69520d2d39 Remove special handling for missing crypto_blkdev
This logic is no longer necessary, since the code that creates the
crypto_blkdev (create_crypto_blk_dev() in MetadataCrypt.cpp or in
cryptfs.cpp) now waits for the block device to appear before continuing.

It's also worth noting that the retry loop was only present for ext4,
not for f2fs, yet most Android devices are using f2fs these days.

Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: I173ca6cc187a810e008990dfa22aede58632db25
2020-11-03 14:11:01 -08:00
Eric Biggers
88f993b4a8 Check return value of create_crypto_blk_dev()
cryptfs_enable_internal() forgot to check the return value of
create_crypto_blk_dev(), so it was continuing to
cryptfs_enable_inplace() when creating the dm-crypt device failed, which
doesn't make sense.

Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: If9f20069d0f084150aa887a350f7c0c31a6d80f2
2020-11-03 14:11:00 -08:00
Eric Biggers
c01995ea3b Remove unused support for partial encryption
Commit 87999173dd ("Don't corrupt ssd when encrypting and power
fails") added a lot of code to handle pausing in-place conversion from
unencrypted => FDE when the battery was low, and resuming it later.

It was eventually decided that this wasn't needed, and commit
7e17e2d226 ("Don't worry about battery levels when encrypting")
removed the checks for low battery.

This made the partial encryption code unused.  So remove it.

Note that this was cluttering up the metadata encryption code too, since
EncryptInplace.cpp is now shared by both FDE and metadata encryption.

Bug: 16868177
Test: see I08fc8465f7962abd698904b5466f3ed080d53953
Change-Id: Ibd2eb08a2aa15938097abcb8a67b5a813c4d76c7
2020-11-03 14:11:00 -08:00
Eric Biggers
0bea8cede9 Merge changes I8d2bd67d,I704522b2 am: 27f3ab89d0 am: 5a9feb48fa am: 61ffc1b096
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1484498

Change-Id: I62f8835572ec93c4808b9af26b39dc0fbe22fe91
2020-11-03 18:19:09 +00:00
Eric Biggers
61ffc1b096 Merge changes I8d2bd67d,I704522b2 am: 27f3ab89d0 am: 5a9feb48fa
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1484498

Change-Id: Ia206b84e8b2ec96882da9c51102f955161ca06f3
2020-11-03 18:04:23 +00:00
Eric Biggers
5a9feb48fa Merge changes I8d2bd67d,I704522b2 am: 27f3ab89d0
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1484498

Change-Id: I28ef08b0fe9b3c94b02769f43e21f574e524da57
2020-11-03 17:48:09 +00:00
Eric Biggers
27f3ab89d0 Merge changes I8d2bd67d,I704522b2
* changes:
  FsCrypt: silently skip "." and ".." when loading keys
  Utils: add IsDotOrDotDot() and use it in the appropriate places
2020-11-03 17:02:46 +00:00
Eric Biggers
9a67e05fc3 Merge "KeyUtil: don't use keepOld=true for system DE and volume keys" am: 4a969dba60 am: 1d692f3b7b am: 83ff4db88a
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1480696

Change-Id: I23bd8f557ddd143a9e1efa1d9e79a8181f9a5901
2020-11-03 00:43:46 +00:00
Eric Biggers
83ff4db88a Merge "KeyUtil: don't use keepOld=true for system DE and volume keys" am: 4a969dba60 am: 1d692f3b7b
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1480696

Change-Id: Idec4eb2c0afca69c0b322935397bea009f5683f1
2020-11-03 00:23:55 +00:00
Eric Biggers
2c9d6d6675 KeyUtil: don't use keepOld=true for system DE and volume keys
Commit 77df7f207d / http://aosp/1217657 ("Refactor to use
EncryptionPolicy everywhere we used to use raw_ref") unintentionally
made fscrypt_initialize_systemwide_keys() start specifying keepOld=true
(via default parameter value) when retrieving the system DE key, and
likewise for read_or_create_volkey() and volume keys.

As a result, if the associated Keymaster key needs to be upgraded, the
upgraded key blob gets written to "keymaster_key_blob_upgraded", but it
doesn't replace the original "keymaster_key_blob", nor is the original
key deleted from Keymaster.  This happens at every boot, eventually
resulting in the RPMB partition in Keymaster becoming full.

Only the metadata encryption key ever needs keepOld=true, since it's the
only key that isn't stored in /data, and the purpose of keepOld=true is
to allow a key that isn't stored in /data to be committed or rolled back
when a userdata checkpoint is committed or rolled back.

So, fix this bug by removing the default value of keepOld, and
specifying false everywhere except the metadata encryption key.

Note that when an affected device gets this fix, it will finally upgrade
its system DE key correctly.  However, this fix doesn't free up space in
Keymaster that was consumed by this bug.

Test: On bramble:
  - Flashed rvc-d1-dev build, with wiping userdata
  - Flashed a newer build, without wiping userdata
  - Log expectedly shows key upgrades:
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /metadata/vold/metadata_encryption/key
        D vold    : Upgrading key: /data/unencrypted/key
        D vold    : Upgrading key: /data/misc/vold/user_keys/de/0
        D vold    : Upgrading key: /data/misc/vold/user_keys/ce/0/current
  - Rebooted
  - Log unexpectedly shows the system DE key being upgraded again:
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /data/unencrypted/key
  - "keymaster_key_blob_upgraded" unexpectedly still exists:
        $ adb shell find /data /metadata -name keymaster_key_blob_upgraded
        /data/unencrypted/key/keymaster_key_blob_upgraded
  - Applied this fix and flashed, without wiping userdata
  - Log shows system DE key being upgraded (expected because due to the
    bug, the upgraded key didn't replace the original one before)
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /data/unencrypted/key
  - "keymaster_key_blob_upgraded" expectedly no longer exists
        $ adb shell find /data /metadata -name keymaster_key_blob_upgraded
  - Rebooted
  - Log expectedly doesn't show any more key upgrades
        $ adb logcat | grep 'Upgrading key'
Bug: 171944521
Bug: 172019387
(cherry picked from commit c493903732)
Merged-In: I42d3f5fbe32cb2ec229f4b614cfb271412a3ed29
Change-Id: I42d3f5fbe32cb2ec229f4b614cfb271412a3ed29
2020-11-02 16:10:09 -08:00
Eric Biggers
1d692f3b7b Merge "KeyUtil: don't use keepOld=true for system DE and volume keys" am: 4a969dba60
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1480696

Change-Id: I45f11f64c84b540a27cdc39af493a2ee4e552bce
2020-11-03 00:08:56 +00:00
Eric Biggers
6b84039847 FsCrypt: silently skip "." and ".." when loading keys
Avoid logging useless messages like:

    D vold    : Skipping non-key .
    D vold    : Skipping non-key ..
    D vold    : Skipping non-de-key .
    D vold    : Skipping non-de-key ..

Change-Id: I8d2bd67d554605a5ab9faadd3730870dfe0881f6
2020-11-02 15:47:42 -08:00
Eric Biggers
7bcf427369 Utils: add IsDotOrDotDot() and use it in the appropriate places
Change-Id: I704522b26acfb3e7c423d9a14d69ede513b50482
2020-11-02 15:47:24 -08:00
Eric Biggers
4a969dba60 Merge "KeyUtil: don't use keepOld=true for system DE and volume keys" 2020-11-02 23:31:23 +00:00
Eric Biggers
c493903732 KeyUtil: don't use keepOld=true for system DE and volume keys
Commit 77df7f207d / http://aosp/1217657 ("Refactor to use
EncryptionPolicy everywhere we used to use raw_ref") unintentionally
made fscrypt_initialize_systemwide_keys() start specifying keepOld=true
(via default parameter value) when retrieving the system DE key, and
likewise for read_or_create_volkey() and volume keys.

As a result, if the associated Keymaster key needs to be upgraded, the
upgraded key blob gets written to "keymaster_key_blob_upgraded", but it
doesn't replace the original "keymaster_key_blob", nor is the original
key deleted from Keymaster.  This happens at every boot, eventually
resulting in the RPMB partition in Keymaster becoming full.

Only the metadata encryption key ever needs keepOld=true, since it's the
only key that isn't stored in /data, and the purpose of keepOld=true is
to allow a key that isn't stored in /data to be committed or rolled back
when a userdata checkpoint is committed or rolled back.

So, fix this bug by removing the default value of keepOld, and
specifying false everywhere except the metadata encryption key.

Note that when an affected device gets this fix, it will finally upgrade
its system DE key correctly.  However, this fix doesn't free up space in
Keymaster that was consumed by this bug.

Test: On bramble:
  - Flashed rvc-d1-dev build, with wiping userdata
  - Flashed a newer build, without wiping userdata
  - Log expectedly shows key upgrades:
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /metadata/vold/metadata_encryption/key
        D vold    : Upgrading key: /data/unencrypted/key
        D vold    : Upgrading key: /data/misc/vold/user_keys/de/0
        D vold    : Upgrading key: /data/misc/vold/user_keys/ce/0/current
  - Rebooted
  - Log unexpectedly shows the system DE key being upgraded again:
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /data/unencrypted/key
  - "keymaster_key_blob_upgraded" unexpectedly still exists:
        $ adb shell find /data /metadata -name keymaster_key_blob_upgraded
        /data/unencrypted/key/keymaster_key_blob_upgraded
  - Applied this fix and flashed, without wiping userdata
  - Log shows system DE key being upgraded (expected because due to the
    bug, the upgraded key didn't replace the original one before)
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /data/unencrypted/key
  - "keymaster_key_blob_upgraded" expectedly no longer exists
        $ adb shell find /data /metadata -name keymaster_key_blob_upgraded
  - Rebooted
  - Log expectedly doesn't show any more key upgrades
        $ adb logcat | grep 'Upgrading key'
Bug: 171944521
Bug: 172019387
Change-Id: I42d3f5fbe32cb2ec229f4b614cfb271412a3ed29
2020-10-30 14:53:43 -07:00
Eric Biggers
d6f1a98f4b Merge "Fix argument type for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS" am: 569fb8365e am: 524e094991 am: 2fe31ededf
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1472321

Change-Id: Ica87f8b5d1a4eea3e403f5694f2557fa6891d002
2020-10-28 17:18:50 +00:00
Eric Biggers
2fe31ededf Merge "Fix argument type for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS" am: 569fb8365e am: 524e094991
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1472321

Change-Id: I7d9b20e25b93c0f9707714027ab6c15fa9d224f7
2020-10-28 16:50:42 +00:00
Eric Biggers
524e094991 Merge "Fix argument type for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS" am: 569fb8365e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1472321

Change-Id: I5cb2651ee48ab2a9afb9ec5ded8259cd006ecbfe
2020-10-28 16:26:09 +00:00
Eric Biggers
569fb8365e Merge "Fix argument type for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS" 2020-10-28 16:16:26 +00:00
Eric Biggers
f9d9ac29d0 Fix argument type for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS
These ioctls take a pointer to an 'int' (or an 'unsigned int', it
doesn't matter), not an 'unsigned long'.  See 'man ioctl_iflags'.
Presumably it happened to work anyway because Android only runs on
little endian platforms.

Bug: 146419093
Bug: 163453310
Change-Id: I73099dafd4ee8d497c0a754149271871a37454f6
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-10-28 04:48:09 +00:00
Yo Chiang
a182ca0ef1 Merge "Add IVold::destroyDsuMetadataKey()" am: cb581cc8de am: 3ae0c6737c am: 9502610f8e
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1452395

Change-Id: I79d72f95e00888afa69f55b48e76f28d47972457
2020-10-26 06:37:07 +00:00
Yo Chiang
9502610f8e Merge "Add IVold::destroyDsuMetadataKey()" am: cb581cc8de am: 3ae0c6737c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1452395

Change-Id: I7cb2b806de2f70e6ce569001d79f07a4ce6c8556
2020-10-26 06:20:25 +00:00
Yo Chiang
3ae0c6737c Merge "Add IVold::destroyDsuMetadataKey()" am: cb581cc8de
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1452395

Change-Id: I6241d71e331eebe0222696a052e40d2222a9c537
2020-10-26 05:49:35 +00:00
Yo Chiang
cb581cc8de Merge "Add IVold::destroyDsuMetadataKey()" 2020-10-26 05:27:36 +00:00
Treehugger Robot
4bcbd7a4d7 [automerger skipped] Merge "Set media folder +F for adopted storage as well" am: 739ca2c298 am: 19adff5f27 am: e2fefec3bb -s ours
am skip reason: Change-Id I08f13b57a4de3538e88b38eb95b0ac115a5a5ce8 with SHA-1 083221f5cf is in history

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1397560

Change-Id: Iee4294f9e16c934cfc99daed87fd9ad7b678fe56
2020-10-22 05:50:25 +00:00
Treehugger Robot
e2fefec3bb Merge "Set media folder +F for adopted storage as well" am: 739ca2c298 am: 19adff5f27
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1397560

Change-Id: I855399600230f5a27d8058ec7fee0df9b2d22f22
2020-10-22 00:32:21 +00:00
Treehugger Robot
19adff5f27 Merge "Set media folder +F for adopted storage as well" am: 739ca2c298
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1397560

Change-Id: I90d0e56e260094661217dd20135f9fde6da96e98
2020-10-21 23:12:51 +00:00
Treehugger Robot
739ca2c298 Merge "Set media folder +F for adopted storage as well" 2020-10-21 22:04:11 +00:00
Daniel Rosenberg
cc874804dd Set media folder +F for adopted storage as well
We previously only set +F for /data/media, but adopted storage needs
this as well. Instead we add support for adding attrs to PrepareDir.

Bug: 163453310
Test: sm set-virtual-disk true
      follow UI setup and confirm +F on /mnt/expand/*/media
Change-Id: I08f13b57a4de3538e88b38eb95b0ac115a5a5ce8
Merged-In: I08f13b57a4de3538e88b38eb95b0ac115a5a5ce8
2020-10-20 18:55:54 -07:00
Eric Biggers
4855216c24 Merge "vold: Generate storage key without rollback resistance" am: 4f5e9c196f am: b6d1a31949 am: 6417fb00bd
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1426109

Change-Id: I02bf9412685cd1cd0b3bef6783035b9017fce337
2020-10-21 00:51:20 +00:00
Eric Biggers
6417fb00bd Merge "vold: Generate storage key without rollback resistance" am: 4f5e9c196f am: b6d1a31949
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1426109

Change-Id: Iaab2239444df05a089224bd145fe6d9c4baee436
2020-10-21 00:02:21 +00:00
Eric Biggers
b6d1a31949 Merge "vold: Generate storage key without rollback resistance" am: 4f5e9c196f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1426109

Change-Id: Ibf06476010946d799c4b1fa5143ed4eac96f301a
2020-10-20 23:45:41 +00:00
Eric Biggers
4f5e9c196f Merge "vold: Generate storage key without rollback resistance" 2020-10-20 23:17:22 +00:00
Gaurav Kashyap
75736a8811 vold: Generate storage key without rollback resistance
Generate a storage key without rollback_resistance when device doesnt
support the corresponding tag.

Bug: 168527558

Change-Id: Iaf27c64dba627a31c9cbd9178458bf6785d00251
2020-10-20 16:19:33 +00:00
Eric Biggers
5d2092bf82 Merge changes Idc575106,Id6457a2b am: 3e0e53dbe5 am: 8671044a64 am: 377a71922d
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1462712

Change-Id: I13758415cf228dae8b4d708ea67b58acb98781ed
2020-10-19 17:49:13 +00:00
Eric Biggers
e488044d97 Merge "MetadataCrypt: remove unnecessary retry loop" am: 80fdc5a4e3 am: 5a1e03f705 am: c65ba5bd4c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1462708

Change-Id: I897b84d329e2bb58ade03a66bcf7056174180a97
2020-10-19 17:49:03 +00:00
Eric Biggers
36a0a80bdf Merge "Silence useless LOOP_GET_STATUS64 warnings" am: 6f70c92aee am: 4d0d21e69d am: c823f0b95f
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1462709

Change-Id: I0333415fa84d00038d86e7264941cc3249aac41d
2020-10-19 17:48:45 +00:00