Commit graph

3157 commits

Author SHA1 Message Date
Nikita Ioffe
d21a8a495d Merge "Add '/system/bin/vdc volume reset' command" 2019-12-04 19:22:50 +00:00
Oli Lan
ac003c4955 Create directories for snapshots of DE_n and CE_n apex data.
This creates apexrollback directories under /data/misc_[de|ce]/<user>
which will hold snapshots of DE_n and CE_n apex data directories
(i.e. it will hold backups of data from /data/misc_[de|ce]/<user>/apexdata
for particular apexes).

See go/apex-data-directories for details.

Bug: 141148175
Test: Built and flashed, checked directory was created.
Change-Id: I468060b20dee0c50033b5f014ce8716582d5e6bc
2019-12-04 10:29:50 +00:00
Nikita Ioffe
7596581e9f Add '/system/bin/vdc volume reset' command
It will be used during the userspace reboot to unmount all emulated
storages, which is a prerequisite to unmount+remount ext4 userdata into
checkpoint mode.

Test: adb shell /system/bin/vdc checkpoint startCheckpoint 1
Test: adb reboot userspace
Bug: 143970043
Bug: 135984674
Change-Id: I07491bc4be2f30debe21b764766c9def68548e16
2019-12-02 11:51:20 +00:00
Oli Lan
94457217cb Create DE_n and CE_n APEX data directories.
This creates an apexdata directory under /data/misc_de/<user> and
/data/misc_ce/<user>, and also creates a directory under that for
every APEX that is installed.

See go/apex-data-directories.

APEXes are discovered by scanning the /apex directory. It may be better
to delegate this process to a library, but it is proposed to defer that
change to a future CL.

Bug: 141148175
Test: Built and flashed, checked directories were created.
Change-Id: I95a060b4f42241c91da25a779e61a8f85ca1914c
2019-11-21 14:07:18 +00:00
Janis Danisevskis
9f5f518c19 Merge "Removed obsolete Test"
am: 6e3441a8ea

Change-Id: I392f1737c5dfa6e7aee78c7b1af1b016f6f102e9
2019-11-18 16:22:14 -08:00
Treehugger Robot
6e3441a8ea Merge "Removed obsolete Test" 2019-11-19 00:11:11 +00:00
Janis Danisevskis
8c4eb2c2c0 Removed obsolete Test
The HidlizationEquivalenceTest was used to make sure the same key is
computed by the scrypt algorithm regardless of whether the old
(<= KM2 HAL pre treble) or the new (>= KM3.0 treble) HAL was used.
Since the treble is now the default, and old HAL don't even exist on
new devices, we should call the migration a success and drop this test
altogether.

Test: Removed obsolete Code
Bug: 68197448
Change-Id: If10c79bafac4d0c8268675cbb8e1c4b46974aab5
2019-11-18 22:53:30 +00:00
Tianjie Xu
09de0ff8d6 Clear the warm_reset flag after boot is successful
The property is set to inform kernel to do a warm_reset on the next
reboot. This is useful to persist the logs to debug device boot
failures. After the slot has been marked as boot successful, we can drop
the warm_reset flag to avoid the performance overhead on the next
reboot.

Bug: 143489994
Test: check the property is set to 0 by vold
Change-Id: If7c922f40bcf9a6f7894af0a334ab23d88d40d17
2019-11-15 14:06:02 -08:00
Zimuzo Ezeozue
e8db702702 Merge "Add zezeozue to OWNERS"
am: f9972055f5

Change-Id: I45c211d810f1a15e0b5a1f4decc33a0eece8dafd
2019-11-15 08:25:56 -08:00
Zimuzo Ezeozue
f9972055f5 Merge "Add zezeozue to OWNERS" 2019-11-15 16:06:59 +00:00
Zim
076967a823 Add zezeozue to OWNERS
Test: n/a
Change-Id: I75339fcea5d4e537c6312e8e515b6dd62d7ae7fc
2019-11-15 16:03:47 +00:00
shaozhongqi
8006c80960 Merge "Exfat Need to add automatic repair function when exfat fsck device"
am: 7e249ebdae

Change-Id: I835a8717fb25b651ce815c9912322b84e9d66041
2019-11-08 15:18:28 -08:00
Treehugger Robot
7e249ebdae Merge "Exfat Need to add automatic repair function when exfat fsck device" 2019-11-08 22:43:45 +00:00
shaozhongqi
081cf8efdb Exfat Need to add automatic repair function when exfat fsck device
bug:143229109

Test: Manual

Change-Id: Ibf650bdcb378dd9c07f904bdd18b36f376b45b61
Signed-off-by: shaozhongqi <shaozhongqi@xiaomi.com>
2019-10-31 06:37:50 +00:00
Paul Crowley
ce187e7fd6 Merge "Remove libfscrypt now it's in libfs_mgr"
am: 43f8298bdd

Change-Id: I0eaafaa461fa2ec6153a3e3bf49926b2efc610b7
2019-10-30 20:31:55 -07:00
Paul Crowley
43f8298bdd Merge "Remove libfscrypt now it's in libfs_mgr" 2019-10-31 03:17:23 +00:00
Paul Crowley
8bf310b9f3 Remove libfscrypt now it's in libfs_mgr
Now that we include libfscrypt in libfs_mgr via whole_static_libs we
should not reference it directly.

Bug: 143307095
Test: treehugger
Change-Id: I4cd138b50131ec8ce7835d9604c89c99cae53212
2019-10-30 13:34:49 -07:00
Xin Li
b89717b9c3 DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
Bug: 142003500
Change-Id: Ib50f11f8f97ebd427da22b31e484777ef3210fe6
2019-10-30 11:50:46 -07:00
Paul Crowley
18b8ad91b8 Merge changes from topics "fscrypt-options", "fstab-options"
am: c17827b095

Change-Id: I9a992f0da7b5199b40ce650c2eb20258cab2b562
2019-10-28 19:23:05 -07:00
Paul Crowley
0ae752dcc3 Replace "flags" property with "options" with same format as fstab
am: f612b8b5ab

Change-Id: I30c51da82bdeb27a2dae7251762bb1a5241afcb8
2019-10-28 19:22:55 -07:00
Paul Crowley
c17827b095 Merge changes from topics "fscrypt-options", "fstab-options"
* changes:
  Use new encryption_options fstab entry
  Replace "flags" property with "options" with same format as fstab
2019-10-29 02:00:36 +00:00
Paul Crowley
a50f6c3c2c Use new encryption_options fstab entry
Bug: 143307095
Test: change cuttlefish fstab
Change-Id: Ia40daafc9b573c40f29c74dc2ef513fba3fc2bf9
2019-10-28 13:36:35 -07:00
Nikita Ioffe
3dbe996112 Merge "Rename ENFORCE_UID to ENFORCE_SYSTEM_OR_ROOT"
am: f37dff724b

Change-Id: Iaa1ce493c5fc67e280e4e3d656f434ad86e74f80
2019-10-28 03:13:59 -07:00
Nikita Ioffe
f37dff724b Merge "Rename ENFORCE_UID to ENFORCE_SYSTEM_OR_ROOT" 2019-10-28 09:55:34 +00:00
Xin Li
c21f19338e [automerger skipped] Merge "Merge Coral/Flame into AOSP master"
am: be4ff998ac -s ours
am skip reason: change_id I7191bd73d8621831c5802e02817f459f1da32754 with SHA1 a2c2182b65 is in history

Change-Id: If1bc31b59c868707ff2b4ee406bcad0fa9da25d3
2019-10-26 23:39:50 -07:00
Xin Li
119618a381 [automerger skipped] Merge Coral/Flame into AOSP master
am: 8a9454c35c -s ours
am skip reason: change_id I7191bd73d8621831c5802e02817f459f1da32754 with SHA1 a2c2182b65 is in history

Change-Id: I0e4e568d378d9412f2239f37ba2c475ad4f5f30b
2019-10-26 22:36:06 -07:00
Xin Li
be4ff998ac Merge "Merge Coral/Flame into AOSP master" 2019-10-27 04:44:29 +00:00
Nikita Ioffe
e1fd48999b Rename ENFORCE_UID to ENFORCE_SYSTEM_OR_ROOT
A little bit more self-explanatory name that explicitly says that root
is also allowed.

Test: builds
Change-Id: Ice20ffcba2a0994c599dbebace252138ffd827de
Merged-In: Ice20ffcba2a0994c599dbebace252138ffd827de
2019-10-26 15:51:17 +01:00
Paul Crowley
e96e670746 Merge "Use new C++ libfscrypt interface."
am: 7e43d985cf

Change-Id: Ie2a437086f901d4e353e71ac5db8751f518bd833
2019-10-25 11:14:52 -07:00
Paul Crowley
7e43d985cf Merge "Use new C++ libfscrypt interface." 2019-10-25 18:05:26 +00:00
Xin Li
8a9454c35c Merge Coral/Flame into AOSP master
Bug: 141248619
Change-Id: I487bba24e1c3cef357a408424665f0348162345d
Merged-In: I7191bd73d8621831c5802e02817f459f1da32754
2019-10-25 10:28:41 -07:00
Paul Crowley
f612b8b5ab Replace "flags" property with "options" with same format as fstab
Bug: 143307095
Test: Set override, check policy is as expected with sm set-virtual-disk
Change-Id: Iec31d7530b15d6d4564100816c821394e0708d53
2019-10-24 23:24:27 -07:00
Paul Crowley
5e53ff6e8f Use new C++ libfscrypt interface.
Bug: 143307095
Test: treehugger
Change-Id: I420ba6223bd67d6fec5382a11a72b7aa124294c9
2019-10-24 20:49:52 -07:00
TreeHugger Robot
e9679eaa46 Merge "Skip QD1A.190821.011 in stage-aosp-master" into stage-aosp-master 2019-10-24 00:26:50 +00:00
Paul Lawrence
a2c2182b65 Merge "Make sure CtsCheckpointTestCases passes"
am: 21799c8f7d

Change-Id: I7191bd73d8621831c5802e02817f459f1da32754
2019-10-23 15:25:08 -07:00
Treehugger Robot
21799c8f7d Merge "Make sure CtsCheckpointTestCases passes" 2019-10-23 20:13:50 +00:00
Paul Lawrence
4c757fb6cc Make sure CtsCheckpointTestCases passes
Bug: 141639903
Bug: 141499347
Test: Cts test CtsCheckpointTestCases passes
Change-Id: Id5e9c0df969340e0b8f08436daa027614c45b380
2019-10-23 09:40:45 -07:00
Nikita Ioffe
e182b26d64 Merge "vold: implement resetCheckpoint"
am: 4eeebff8d5

Change-Id: I86e933c27ebeaadbc3653d1da412180743d8f519
2019-10-18 15:16:35 -07:00
Nikita Ioffe
4eeebff8d5 Merge "vold: implement resetCheckpoint" 2019-10-18 21:44:35 +00:00
Xin Li
6881ac80c7 Skip QD1A.190821.011 in stage-aosp-master
Bug: 141248619
Change-Id: Ie1bf139b15621fc9cc1270865b03ec0f459d15ed
2019-10-16 15:19:32 -07:00
Nikita Ioffe
a5798fc115 vold: implement resetCheckpoint
It will be used by userspace reboot to reset checkpoint state, to make
sure that when /data is remounted, it will be remounted in checkpointing
if a checkpoint was requested beforee userspace reboot.

Test: /system/bin/vdc startCheckpoint 1
      /system/bin/vdc needsCheckpoint (returns 0)
      /system/bin/vdc resetCheckpoint
      /system/bin/vdc needsCheckpoint (returns 1)

Bug: 135984674
Change-Id: Ia29238686289b4eed93e2fb936a8b3d894b94dc9
2019-10-12 00:43:04 +01:00
Eric Biggers
de5c9ad178 Merge changes from topic "fscrypt-key-mgmt-improvements"
am: 22d50012b0

Change-Id: I97a1990aa2f0bdaf2a622555774b737bfc6d26ab
2019-10-07 12:27:17 -07:00
Eric Biggers
12a9212ac1 vold: use new ioctls to add/remove fscrypt keys when supported
am: f3dc4203dd

Change-Id: I31edb0db46b471233e716b5d277460bb99693d78
2019-10-07 12:27:11 -07:00
Eric Biggers
22d50012b0 Merge changes from topic "fscrypt-key-mgmt-improvements"
* changes:
  vold: support v2 encryption policies
  vold: use new ioctls to add/remove fscrypt keys when supported
2019-10-07 19:09:44 +00:00
Eric Biggers
83a73d7d50 vold: support v2 encryption policies
Add support for setting v2 encryption policies when configured in the
fstab (for internal storage) or in system properties (for adoptable
storage), and for installing and evicting the keys for such policies.

v2 policies support the same encryption modes and flags as v1 policies,
but internally they use a more standard, secure, and flexible KDF.  Due
to this, some future features will be supported by v2 policies only.

Bug: 140500999
Test: Configured a device to use v2 encryption policies (applied the
      needed kernel patches and added
      "fileencryption=aes-256-xts:aes-256-cts:v2" to fstab, and set the
      corresponding system properties for adoptable storage).  Wiped
      userdata, booted device and checked logs to verify that v2
      policies were being used.

      Also enabled virtual SD card and formatted as adoptable storage;
      verified it works and that v2 policies were being used on it.

      Also created, started, and stopped a 2nd user and verified their
      keys were evicted.

      Also verified that the device comes up again after rebooting.

      Also verified that a device using v1 encryption policies continues
      to work, both with and without an updated kernel -- including
      stopping a user so that their keys get evicted.

Change-Id: If64028d8580584b2c33c614cabd5d6b93657f608
2019-10-04 16:04:36 -07:00
Tao Bao
51143b3555 Merge "Mark libvold_headers as recovery_available."
am: 4a13731f08

Change-Id: I52df6333c5c6ce47d9c2cbc3e80d50dc4939c9d1
2019-10-03 17:16:41 -07:00
Treehugger Robot
4a13731f08 Merge "Mark libvold_headers as recovery_available." 2019-10-04 00:01:53 +00:00
Tao Bao
b1bbc7079c Mark libvold_headers as recovery_available.
recovery modules use <cryptfs.h> (in particular CRYPT_FOOTER_OFFSET).

Test: mmma bootable/recovery
Change-Id: I97b038476ccbeb0a5ac4a6cde86063325bdbb152
2019-10-02 10:50:53 -07:00
Eric Biggers
f3dc4203dd vold: use new ioctls to add/remove fscrypt keys when supported
When the kernel supports the new fscrypt key management ioctls, use them
instead of add_key() and keyctl_unlink().

This will be needed in order to support v2 encryption policies, since v2
encryption policies only support the new ioctls.

The new ioctls have other advantages too.  For example,
FS_IOC_REMOVE_ENCRYPTION_KEY automatically evicts exactly the necessary
kernel objects, so the drop_caches sysctl is no longer needed.  This
makes evicting keys faster and more reliable.
FS_IOC_REMOVE_ENCRYPTION_KEY also detects if any files are still open
and therefore couldn't be "locked", whereas this went undetected before.

Therefore, to start out this patch adds support for using the new ioctls
for v1 encryption policies, i.e. on existing devices.

(Originally based on a patch by Satya Tangirala <satyat@google.com>)

Bug: 140500828
Test: tested that a device using v1 policies continues to work, both
      with and without an updated kernel.  See
      If64028d8580584b2c33c614cabd5d6b93657f608 for more details.
      Also checked via the log that the filesystem-level keyring is in
      fact used when supported.
Change-Id: I296ef78138578a3fd773797ac0cd46af1296b959
2019-09-30 13:11:42 -07:00
Daniel Rosenberg
05ce174e84 Merge "Add drosen to OWNERS" am: c0b0795dd6 am: a2e3823145
am: b1372f810c

Change-Id: I84e4b344f245986ced4d9ad4ba05451a4ac7c5ef
2019-09-26 15:07:51 -07:00