Commit graph

3051 commits

Author SHA1 Message Date
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
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
f37dff724b Merge "Rename ENFORCE_UID to ENFORCE_SYSTEM_OR_ROOT" 2019-10-28 09:55:34 +00: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
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
a2e3823145 Merge "Add drosen to OWNERS"
am: c0b0795dd6

Change-Id: Ice2ac2518cb8f384f8ce8a2a12a5a50febe53e15
2019-09-26 14:54:42 -07:00
Daniel Rosenberg
c0b0795dd6 Merge "Add drosen to OWNERS" 2019-09-26 21:30:15 +00:00
Daniel Rosenberg
bc139af7ce Add drosen to OWNERS
Test: build/make/tools/checkowners.py -c -v system/vold/OWNERS
Change-Id: Ic774577a0368f8cdbeb043f8021aec7457198276
2019-09-23 15:52:17 -07:00
Paul Crowley
6db7fa72a5 Merge "Create a per-boot key on each boot"
am: dab5ddf663

Change-Id: Iee4dabdcccedcbf652ae23edb4d20404947a765c
2019-09-16 23:01:13 -07:00
Paul Crowley
dab5ddf663 Merge "Create a per-boot key on each boot" 2019-09-17 05:40:05 +00:00
Eric Biggers
c302876a95 Merge "vold: use system-clang-format"
am: 7e65d8dd00

Change-Id: Ib0e898e67aa0032d53e52676a93b56b0640e11cf
2019-09-16 14:20:47 -07:00
Eric Biggers
7e65d8dd00 Merge "vold: use system-clang-format" 2019-09-16 21:03:26 +00:00
Eric Biggers
f220170923 vold: use system-clang-format
Link .clang-format to the standard .clang-format file (4-space-indent
version) from build/soong, rather than use a custom file.

Among other changes, the standard file has the "IncludeBlocks: Preserve"
setting, so include blocks stay in order.

Don't actually reformat all the code yet.

Test: Tried 'clang-format -i $(find . -name \*.cpp -o -name \*.h)'
      and checked that the changes look sane.
Change-Id: I11ecbd03b31e44ba7b3e01175a6fc317f8173ab0
2019-09-16 12:00:40 -07:00
Paul Crowley
a462a57b18 Merge "Add ebiggers to OWNERS"
am: 88dba9a558

Change-Id: I70868eab667ea5566164ec4d8a5d19e230a89736
2019-09-16 10:42:06 -07:00
Paul Crowley
88dba9a558 Merge "Add ebiggers to OWNERS" 2019-09-16 17:23:02 +00:00
Paul Crowley
c8a3ef3f3c Create a per-boot key on each boot
Bug: 140882488
Test: Booted twice, checked logs to ensure encryption
    is different each time, adb created files in directory.
Change-Id: I74077bf8f727dab726c25f512ed7406a74cbe0bf
2019-09-13 15:46:48 -07:00
Paul Crowley
a13d33af46 Add ebiggers to OWNERS
Test: n/a
Change-Id: I08ece80400dae0c0d25c2fcef7168bbed9034745
2019-09-13 15:06:45 -07:00
Shawn Willden
0b895c13bc Merge "Request rollback resistance for FBE keys."
am: aae52f4816

Change-Id: Ie2143da9b9b1d2e76faa958d1a04d2be6b0045e7
2019-09-12 09:29:15 -07:00
Treehugger Robot
aae52f4816 Merge "Request rollback resistance for FBE keys." 2019-09-12 15:20:45 +00:00
Xin Li
69a1fd86d3 Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
Bug: 135460123
Change-Id: I1605f33ede34c8289a6eede94b62c8695df81b63
Merged-In: I24f07ba89ba6e6dac8adc2a6bb654d75d2b73d3e
2019-09-08 13:07:03 -07:00
Steven Moreland
e3b772e0f7 Merge "Remove libhwbinder/libhidltransport deps"
am: 88a19b6fe1

Change-Id: I24f07ba89ba6e6dac8adc2a6bb654d75d2b73d3e
2019-09-06 14:32:26 -07:00
Treehugger Robot
88a19b6fe1 Merge "Remove libhwbinder/libhidltransport deps" 2019-09-06 20:12:41 +00:00
Steven Moreland
4496ef9d34 Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I890b572d537d66ecb49effd8efc782279c52956e
2019-09-05 14:18:22 -07:00
Xin Li
d3ceab2566 Merge "DO NOT MERGE - Merge Android 10 into master" 2019-09-05 16:53:32 +00:00
Xin Li
85a94961df DO NOT MERGE - Merge Android 10 into master
Bug: 139893257
Change-Id: I9dc8417f0d87c87eac13437834e69a52c1887258
2019-09-04 13:35:31 -07:00
Paul Lawrence
3096e373be Merge "Fix ext4/metadata/udc issue"
am: ee867be1f1

Change-Id: I69b89b464a4d04b27e1da7d3990dcbec9525afe4
2019-08-27 08:45:00 -07:00
Paul Lawrence
ee867be1f1 Merge "Fix ext4/metadata/udc issue" 2019-08-27 15:21:58 +00:00
Paul Lawrence
6c5944f899 Merge "Fix crash in mainline"
am: 3a0d51f6b7

Change-Id: I63925fd090707f56076a59349c237a83f4ec8234
2019-08-26 18:32:29 -07:00
Treehugger Robot
3a0d51f6b7 Merge "Fix crash in mainline" 2019-08-27 01:01:28 +00:00