Commit graph

1581 commits

Author SHA1 Message Date
Keun-young Park
3918ae6c76 Merge "make shutdown safe for double calls." am: 71fa1068de am: 2f93c657f4
am: 2a8605b9d1

Change-Id: Id1cd83d307e7791359bc6dfd96368f1138ff21d2
2017-03-15 02:56:40 +00:00
Keun-young Park
2a8605b9d1 Merge "make shutdown safe for double calls." am: 71fa1068de
am: 2f93c657f4

Change-Id: I78962b7272ef0c39a133db042f36684fc1324018
2017-03-15 02:52:10 +00:00
Keun-young Park
2f93c657f4 Merge "make shutdown safe for double calls."
am: 71fa1068de

Change-Id: I161c96dc5a44890fffe8fcdf9e0f8fc874df29c0
2017-03-15 02:47:09 +00:00
Treehugger Robot
71fa1068de Merge "make shutdown safe for double calls." 2017-03-15 02:39:51 +00:00
Keun-young Park
a5bbb5e3c1 make shutdown safe for double calls.
- In new shutdown sequence, volume shutdown is requested in two places:
  system_server and init.
- Make VolumeManager.shutdown safe for double calls.
  It crashed before this change.

bug: 36004738
Test: reboot and check last_kmsg for crash / vdc timeout
Change-Id: I296913959b2647b65d66553073f2032545beba57
2017-03-14 17:27:02 -07:00
Bowgo Tsai
3b0a884381 Merge "vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()" am: 92f21f5294 am: f53cc1b04a
am: b169603d95

Change-Id: Ic3ac2ccb853b43d9051d3703f19590cf97b3e689
2017-03-10 03:17:52 +00:00
Bowgo Tsai
b169603d95 Merge "vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()" am: 92f21f5294
am: f53cc1b04a

Change-Id: I05095049ec6f478c3b9b31bccd6c828cf52b7d7c
2017-03-10 02:15:05 +00:00
Bowgo Tsai
f53cc1b04a Merge "vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()"
am: 92f21f5294

Change-Id: I830cc6be023737b9befc112fdf9b010996314ec9
2017-03-10 02:12:40 +00:00
Treehugger Robot
92f21f5294 Merge "vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()" 2017-03-10 02:07:34 +00:00
Bowgo Tsai
e8fb6c3000 vold: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()
The original default /fstab.{ro.hardware} might be moved to /vendor/etc/.
or /odm/etc/. Use the new API to get the default fstab instead of using
the hard-coded /fstab.{ro.hardware}.

Bug: 35811655
Test: boot marlin with /vendor/etc/fstab.marlin
Change-Id: I92d6aefe6ff3433b7d1a671358d990bb7b1f2150
2017-03-09 23:31:18 +08:00
Janis Danisevskis
e7152c38df Fix missing error handling in keymaster comatibility check
The compatibility check assumes that the keymaster session was created
successfully which is a faulty assumption.

This patch adds propper error handling to the check.

Bug: 35576166
Change-Id: I0c70a0e53f488f8bd3164898722f490cd0573ce3
2017-03-08 11:02:30 -08:00
Wei Wang
a3b6d90934 Merge "vold: add coldboot back and make sure it won't block booting" am: b3715cf3af am: 5457b47f9e
am: 660006e7a4

Change-Id: I21e4ba746c99bd8c372d802f11f0bb3f36376553
2017-03-07 20:30:10 +00:00
Wei Wang
660006e7a4 Merge "vold: add coldboot back and make sure it won't block booting" am: b3715cf3af
am: 5457b47f9e

Change-Id: If63bbecc52fec415b38b86ddc32706a3742fcad3
2017-03-07 20:29:11 +00:00
Wei Wang
5457b47f9e Merge "vold: add coldboot back and make sure it won't block booting"
am: b3715cf3af

Change-Id: I725dc07d0bd3afa73081affb56a24e6a216ec9d2
2017-03-07 20:25:40 +00:00
Treehugger Robot
b3715cf3af Merge "vold: add coldboot back and make sure it won't block booting" 2017-03-07 20:24:01 +00:00
Calin Juravle
4c4958d706 Merge "Vold: Clean up code related to foreign dex use" am: 61a7d1a815 am: aaa95fbdfe
am: 0a8d4511c8

Change-Id: I3a84eca8a285bed3ec42c8744db8974e0109fb65
2017-03-07 19:10:47 +00:00
Calin Juravle
0a8d4511c8 Merge "Vold: Clean up code related to foreign dex use" am: 61a7d1a815
am: aaa95fbdfe

Change-Id: I71276a5d18d6c81c97b6c31086a7d9eef47fece4
2017-03-07 19:08:15 +00:00
Calin Juravle
aaa95fbdfe Merge "Vold: Clean up code related to foreign dex use"
am: 61a7d1a815

Change-Id: I296f71434198c41c9ba340891efaf472e3d69dd6
2017-03-07 19:06:15 +00:00
Calin Juravle
61a7d1a815 Merge "Vold: Clean up code related to foreign dex use" 2017-03-07 19:00:18 +00:00
Wei Wang
2edbe28add vold: add coldboot back and make sure it won't block booting
coldboot is needed when device rebooted with USB device attched
so Vold netlink won't miss the information.
This CL added back coldboot and moved down so that it won't block
vold cl and ccl threads.

Bug: 36007238
Test: reboot marlin with flash drive attached and flash drive is recognized
Change-Id: Ie39f348e97a8500515e394e386541289a91b2425
2017-03-06 17:49:37 -08:00
Calin Juravle
3a68f14192 Vold: Clean up code related to foreign dex use
We simplified the way we track whether or not a dex file is used by
other apps. DexManger in the framework keeps track of the data and we
no longer need file markers on disk.

Test: device boots, foreign dex markers are not created anymore

Bug: 32871170
Change-Id: Id0360205b019be92049f36eab4339f4736e974f4
2017-03-03 18:24:21 -08:00
TreeHugger Robot
64a11b177c Merge "Change to use new WaitForProperty API" 2017-02-25 08:17:59 +00:00
Wei Wang
4375f1be4c Change to use new WaitForProperty API
Change to use WaitForProperty API to wait for vold.post_fs_data_done
Also change cryptfs to C++

Bug: 35425974
Test: mma, marlin/angler boot

Change-Id: Id821f2035788fcc91909f296c83c871c67571de3
2017-02-24 17:47:53 -08:00
Chris Phoenix
9e8a577a63 keymaster HAL uses "default" service name
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.

Test: marlin boots

Bug: 33844934
Change-Id: I7c68c8b9ab0101b2f10ca20b9971a5bd34377168
2017-02-24 14:31:39 -08:00
Rubin Xu
d21cde6435 Merge "Support keys with a secret but no token, which are handled not using Keymaster but in-process crypto." 2017-02-15 22:37:42 +00:00
Isaac Chen
fec6ba5c8c Merge "Removed HW encryption build flags and related code." am: bf8518056d am: 95dc636942 am: 730c6196a2
am: 2f88e97172

Change-Id: I2decffa399cbc941b93ba251957f2a9168945d29
2017-02-15 09:00:36 +00:00
Isaac Chen
2f88e97172 Merge "Removed HW encryption build flags and related code." am: bf8518056d am: 95dc636942
am: 730c6196a2

Change-Id: I3a24fffb05b8376f60d085f73354266cb4b4295d
2017-02-15 08:57:14 +00:00
Isaac Chen
730c6196a2 Merge "Removed HW encryption build flags and related code." am: bf8518056d
am: 95dc636942

Change-Id: Id8db71142589232ec4342bb025761e645fd8dac2
2017-02-15 08:54:13 +00:00
Isaac Chen
95dc636942 Merge "Removed HW encryption build flags and related code."
am: bf8518056d

Change-Id: I969e9062b6c4d1827614d8272539489d26320f0d
2017-02-15 08:51:13 +00:00
Isaac Chen
bf8518056d Merge "Removed HW encryption build flags and related code." 2017-02-15 08:45:30 +00:00
TreeHugger Robot
dcbe194891 Merge "Port cryptfs to HILD keymaster HAL" 2017-02-15 00:09:02 +00:00
Isaac Chen
dff70b4e3e Removed HW encryption build flags and related code.
TARGET_HW_DISK_ENCRYPTION and TARGET_CRYPTFS_HW_PATH build flags
and related code in cryptfs.c are removed since it doesn't match
the driver in current tree.

To enable HW encryption, the driver needs to be hidlized.

Bug: 34268168

Test: compile
Change-Id: I507a0e2908b3c407c565e44873b82c94a8305de6
2017-02-14 20:40:00 +08:00
Janis Danisevskis
015ec30b36 Port cryptfs to HILD keymaster HAL
Cryptfs uses keymaster for key derivation. Vold has a C++ abstraction
for Keymaster. However, cryptfs, being a pure C implementation, uses
its own abstraction of the keymaster HAL.

This patch expresses cryptfs' keymaster abstraction in terms of
vold's C++ Keymaster abstraction, consolidating the code base to a
single point where the actual keymaster HAL is beeing used.

Test: successfully upgrade bullhead/angler while using FDE and
      having a PIN set
      run vold_cryptfs_scrypt_hidlization_equivalence_test

Bug: 35028230
Bug: 32020919
Change-Id: Ic3b765720be0cf7899dda5005fa89347ffb59b9f
2017-02-14 11:18:51 +00:00
Paul Crowley
6ab2cabd19 Support keys with a secret but no token, which are handled not using
Keymaster but in-process crypto.

Bug: 33384925
Test: manual for now: patch KeyAuthentication.usesKeymaster() to always return true;
      flash a FBE device, add a device PIN, reboot and verify PIN can unlock FBE.
      Then clear device PIN, reboot and verify FBE is unlocked automatically.
      In both cases, check there is no keymaster_key_blob in
      /data/misc/vold/user_keys/ce/0/current/
      Unit tests to be added.
Change-Id: Ia94e2b39d60bfd98c7a8347a5ba043eeab6928c5
2017-02-13 23:37:31 +00:00
Paul Crowley
48523266cb Merge "vold: allow specifying HEH filenames encryption" 2017-02-13 16:39:13 +00:00
George Burgess IV
d8c0a7e426 Merge "Add mode bits to open calls" am: cebf7ea40f am: 385dae25c5 am: 94f2d7653c
am: da162a77f1  -s ours

Change-Id: I37b921fcff9a5fa5104a2e59de3e1dad48c88e1d
2017-02-09 04:22:45 +00:00
George Burgess IV
da162a77f1 Merge "Add mode bits to open calls" am: cebf7ea40f am: 385dae25c5
am: 94f2d7653c

Change-Id: I4c9671b6dbc9bce7ad0b8af8021301232aa491db
2017-02-09 04:20:46 +00:00
George Burgess IV
94f2d7653c Merge "Add mode bits to open calls" am: cebf7ea40f
am: 385dae25c5

Change-Id: I715bc43c7df865f350162fdf620a354782304fdf
2017-02-09 04:18:15 +00:00
George Burgess IV
385dae25c5 Merge "Add mode bits to open calls"
am: cebf7ea40f

Change-Id: I8620b354dc51f500edac492b94c0bf28852f5135
2017-02-09 04:16:45 +00:00
Treehugger Robot
cebf7ea40f Merge "Add mode bits to open calls" 2017-02-09 04:12:36 +00:00
Eric Biggers
b45caafbcc vold: allow specifying HEH filenames encryption
Make the vold changes needed to support specifying aes-256-heh filenames
encryption.  The previous mode, aes-256-cts, remains supported as well.

The file /data/unencrypted/mode is updated to have the syntax
contents_encryption_mode[:filenames_encryption_mode] instead of just
contents_encryption_mode.  This is consistent with the new fstab syntax.

Bug: 34712722
Change-Id: Ibc236d0ec4fdeda4e4e301f45fb996317692cfa3
2017-02-07 20:53:45 +00:00
Alex Klyubin
cfc5202147 Revert "Port cryptfs to HILD keymaster HAL"
bullhead-userdebug with disk encryption enabled and with PIN prompt at
boot can no longer unlock/mount encrypted userdata partition at boot
after updating from bullhead-userdebug prior to the two commits being
reverted here.

    This reverts commit 6b7fa1bf17.
    This reverts commit bbe31ba776.

Test: Flash bullhead-userdebug build created prior to the above two
      commits, enable disk (set PIN to 1234) with PIN required at
      boot, reboot, confirm that PIN prompt accepts the PIN, confirm
      that device fully boots up and appears operational. Flash build
      with this commit without wiping userdata, confirm that PIN
      prompt at boot accepts the PIN and device fully boots up and
      appears operational.
Bug: 35028230

Change-Id: I1e9303e9d007c0c9a3021c874340156748dff5f5
2017-02-06 10:19:46 -08:00
Janis Danisevskis
bbe31ba776 Cosmetic change to 6b7fa1b
Test: no functional change
Change-Id: I7f630473e317cbee73125955260f5aad0a000630
2017-02-06 11:41:31 +00:00
Janis Danisevskis
6b7fa1bf17 Port cryptfs to HILD keymaster HAL
Cryptfs uses keymaster for key derivation. Vold has a C++ abstraction
for Keymaster. However, cryptfs, being a pure C implementation, uses
its own abstraction of the keymaster HAL.

This patch expresses cryptfs' keymaster abstraction in terms of
vold's C++ Keymaster abstraction, consolidating the code base to a
single point where the actual keymaster HAL is beeing used.

Test: marlin device boots with FBE enabled
Change-Id: Ia51fed5508e06fd6c436cca193791e57e0ab99ea
2017-02-03 07:00:47 +00:00
TreeHugger Robot
bcbf326779 Merge changes I00a897dd,I802e1c04
* changes:
  Remove appfuse mount point directory after unmounting.
  Use MNT_DETACH when unmounting appfuse mount.
2017-01-30 02:48:31 +00:00
George Burgess IV
2a6ff153ee Add mode bits to open calls
This was already done internally a while ago, but for us to submit
clang FORTIFY, we need it here, as well.

Bug: 32073964
Test: Clang FORTIFY no longer complains about open calls here.
Change-Id: I72428ac4d3279ffc330ae5aa579960c26703053c
Merged-In: Iaed2538831b19ada26005bbef33cff28209c6512
2017-01-25 13:21:17 -08:00
Wei Wang
b7336860a6 Merge "Remove coldboot from vold" am: cc29c526d4 am: 9a2e29fe32 am: 78bf4cbb12
am: 787930f5b6

Change-Id: Id9b356819d22c23d79a576851580a1016f799ecb
2017-01-25 19:52:55 +00:00
Wei Wang
787930f5b6 Merge "Remove coldboot from vold" am: cc29c526d4 am: 9a2e29fe32
am: 78bf4cbb12

Change-Id: Idbeaf5ef67d59318507a83ad988a6dff45356b2b
2017-01-25 19:50:28 +00:00
Wei Wang
78bf4cbb12 Merge "Remove coldboot from vold" am: cc29c526d4
am: 9a2e29fe32

Change-Id: I67f5eb8a7c1192449b11ffd7500222d6409d2f04
2017-01-25 19:48:25 +00:00
Wei Wang
9a2e29fe32 Merge "Remove coldboot from vold"
am: cc29c526d4

Change-Id: I3de54db5f27692ab47ddf047ede056c536424438
2017-01-25 19:45:53 +00:00