Commit graph

3060 commits

Author SHA1 Message Date
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
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
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
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
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
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
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