Commit graph

1244 commits

Author SHA1 Message Date
Martijn Coenen
47ff14ad38 Merge "Move vold (and sdcard childs) to foreground cpuset." into nyc-dev 2016-04-25 17:46:02 +00:00
Paul Lawrence
0264d8ff7c Merge "Don't start defaultcrypto twice" into nyc-dev 2016-04-19 14:44:26 +00:00
Paul Lawrence
84274cc35c Don't start defaultcrypto twice
The old way (using triggers) starts defaultcrypto twice because
queue_property_triggers_action retriggers the action.

Bug: 27452459

Change-Id: I715d5441f8ae0b820b680f6a75f51694c4420992
2016-04-18 15:39:04 -07:00
Jeff Sharkey
be70c9ae22 Consistent creation/destruction of user data.
Preparing and destroying users currently needs to be split across
installd, system_server, and vold, since no single party has all the
required SELinux permissions.

Bug: 27896918, 25861755
Change-Id: Ieec14ccacfc7a3a5ab00df47ace7318feb900c38
2016-04-15 13:47:52 -06:00
Martijn Coenen
624ec66b26 Move vold (and sdcard childs) to foreground cpuset.
Bug: 24949295
Change-Id: I7118a374db90ede517a92f72763d624b9a234ea7
2016-04-15 14:30:40 +02:00
Yabin Cui
cbedcc30b3 Merge "vold: write bootloader message directly." into nyc-dev 2016-04-08 21:03:43 +00:00
Daichi Hirono
2d6555f33a Add log flag for verbose AppFuse log for nyc-dev.
Change-Id: I60ca596e32f8668ae5895e671d92c4978ede6314
Fixed: 28055420
2016-04-07 14:59:32 +09:00
Yabin Cui
ffa2e09921 vold: write bootloader message directly.
Bug: 27176738
Change-Id: I09bfe777e383325809d7ecc2dcb9129fe234053f
2016-04-06 17:21:38 -07:00
Jeff Sharkey
8aff854b94 Kill apps using PublicVolume when unmounting.
Bug: 24863778
Change-Id: I86a482c6de78afe2e09ca91165000e1b10a42058
2016-03-30 20:37:30 -06:00
Paul Crowley
71ee662ec3 Don't fail if the CE key isn't loaded in destroy_user_key
Users don't have to be unlocked to be deleted, so don't worry if we
don't have their key to evict.

Bug: 26847403
Bug: 27441228
Change-Id: Ifd93f620926630aa102a3bb4a5d2d45d34f9b75d
2016-03-29 13:07:34 -07:00
Paul Crowley
0323afd69d Support Keymaster2 with lots of clever template logic :)
Bug: 27718275
Change-Id: I0b2aa74f45fd07a121ce0c342b27426a3fe593ce
2016-03-17 10:56:24 -07:00
Paul Lawrence
300dae7c38 Fix some static analyser issues
Bug: 27099772
Change-Id: Ic96777edf4ea282be2b8f53525226396c01e023c
2016-03-11 11:02:52 -08:00
Paul Lawrence
439034b8cc Merge "Make sure encryption type is set on first boot" into nyc-dev 2016-03-11 01:42:55 +00:00
Jeff Sharkey
f84fe90714 Merge "Print size as unsigned when sending to framework." into nyc-dev 2016-03-11 00:07:25 +00:00
Paul Lawrence
4ed4526e68 Make sure encryption type is set on first boot
Bug: 27599622
Change-Id: I2f38c03941ac8cdba40baf7421132f572866e296
2016-03-10 15:44:21 -08:00
Jeff Sharkey
d087bbc66f Print size as unsigned when sending to framework.
Otherwise we might output negative numbers that confuse the rest
of the recovery stack.

Bug: 26007445
Change-Id: Ic99b49360732e5389c6330be065e1222e25b60ca
2016-03-10 12:11:20 -07:00
Prathmesh Prabhu
828d386c7d Merge "Support emulator's virtio-blk based SD card" into nyc-dev 2016-03-10 17:12:59 +00:00
Daniel Rosenberg
19d76fda3a Merge "Add information to error message" into nyc-dev 2016-03-09 23:58:12 +00:00
Daniel Rosenberg
25a5213c1f Add information to error message
Bug: 27452459
Change-Id: I89e813755da0946de4effd827799681df7e12d82
2016-03-09 13:53:39 -08:00
Paul Crowley
df528a7011 Run clang-format over ext4crypt related code
The formatting here is inconsistent with Android house style; use
clang-format to bring it back into line.

Change-Id: Id1fe6ff54e9b668ca88c3fc021ae0a5bdd1327eb
2016-03-09 09:34:13 -08:00
Paul Crowley
a051eb7a22 Use pointers not references for out arguments
Google/Android C++ style requires that arguments passed in for writing
should be pointers, not references, so that it's visible in the caller
that they'll be written to.

Bug: 27566014
Change-Id: I5cd55906cc4b2f61c8b97b223786be0b3ce28862
2016-03-09 09:32:02 -08:00
Paul Crowley
320e5e15b6 Require the auth token for decryption.
A bug meant that the auth token wasn't being used; it turns out that
in order to use it we need to do things slightly differently.

Bug: 27496553
Change-Id: I0f0ab77fed31b92a79eba4acf488cb098691b4be
2016-03-08 14:32:00 -08:00
Paul Crowley
d9b9295b8c Fix memory leak in generate_key wrapper. Other fixes.
- catch errors in looking for the keyring
- static_assert to prevent a buffer overrun
- remove obsolete, misleading comment
- dial down priority of some log messages
- explain why we ignore some errors
- idiomatic C++11

Bug: 27552432
Change-Id: Ic3ee05b41eae45e7c6b571a459b326a483663526
2016-03-08 14:31:49 -08:00
Yu Ning
942d4e830b Support emulator's virtio-blk based SD card
Currently, vold only supports MMC (for SD cards) and SCSI (for USB
drives) devices. It does not recognize any device whose major number is
not one of those used by MMC and SCSI. Unfortunately, virtio-blk is one
such device. It is used by the new Android emulator (a.k.a. qemu2,
featuring the "ranchu" virtual board) for SD card emulation.

In order to make this virtio-blk based SD card device appear in Android
and appear as an SD card (rather than a USB drive), changes have to be
made to both vold (wherever the device major number is checked) and
ranchu's storage configuration. This CL implements former.

This is a stop-gap solution for emulator in nyc.
A longer term solution in-tune with upstream kernel is in the pipes.

Updated from aosp/master version.

BUG:27431753

Change-Id: I5014edec73be7c5b565d91542464c82cbe58992c
Signed-off-by: Yu Ning <yu.ning@intel.com>
(cherry picked from commit 5b1d1c7dfa13b4dca75213581dc8351b841b76c8)
2016-03-08 12:19:41 -08:00
Paul Crowley
ad8e26297b Merge "Use a proper key length for the mode." into nyc-dev 2016-03-02 18:59:58 +00:00
Paul Crowley
2199069aca Use a proper key length for the mode.
Bug: 27440526
Change-Id: I818450252dcd39f21948fc2e70856659eba5f50f
2016-03-02 10:39:53 -08:00
Calin Juravle
d1ee944f08 Prepare profile directories only for the internal storage
Bug: 27444691
Change-Id: I0d30e8883fe655c90cda47ab167a878764ea0802
2016-03-02 18:36:50 +00:00
Calin Juravle
493f5aa160 Create profile folder for foreign dex markers.
This is a special profile folder where apps will leave profile markers
for the dex files they load and don't own. System server will read the
markers and decide if the apks should be fully compiled instead of
profile guide compiled.

Bug: 27334750
Bug: 26080105
Change-Id: Ib18f20cf78a8dbfc465610ec6ceec52699c5420a
2016-02-25 23:31:50 +00:00
Calin Juravle
79f55a461f Prepare user profile folder
Bug: 26719109
Bug: 26563023
Change-Id: I4737b7f73df74b2b787a62db2e231f136115b359
2016-02-19 13:43:02 +00:00
Paul Crowley
ad2eb64413 Log a warning if old creds passed to change_user_key don't work.
Bug: 26948053
Change-Id: I8c117bfe5e85e73af72b6ecafea39924f3561c7c
2016-02-10 17:56:05 +00:00
Paul Crowley
63c18d3ba9 Add scrypt-based password stretching.
Bug: 27056334
Change-Id: Ifa7f776c21c439f89dad7836175fbd045e1c603e
2016-02-10 14:07:59 +00:00
Paul Lawrence
58e9c2a4aa Merge "Fix encryption on non-default devices" into nyc-dev 2016-02-09 19:32:44 +00:00
Paul Lawrence
42b2837cfa Fix encryption on non-default devices
Bug: 27061863
Change-Id: Id998bb4534f657079e95718ef52af3f23100fb10
2016-02-09 11:24:28 -08:00
Paul Crowley
76107cb3f4 Prefer bool returns to int throughout
Change-Id: Ib3592b598ee07bc71a6f9507570bf4623c1cdd6a
2016-02-09 10:11:42 +00:00
Paul Crowley
38132a1f66 Refactor now that global DE has been reworked
Change-Id: I4d6156332cfc847e25e7c8863fd6a50fa325fb87
2016-02-09 10:11:42 +00:00
Paul Crowley
57eedbf8cb Fix some "false" returns to be "-1" where appropriate in e4crypt_enable
Also fix a PLOG that should be a LOG.

Change-Id: Ic5ae288c37b6e236172f9e38349c2d0d530bfd4d
2016-02-09 10:11:42 +00:00
Jeff Sharkey
695d928286 e4crypt_unlock_user_key no longer likes nullptr.
Bug: 27075797
Change-Id: I835d17d02ea50a88ef0a5322a30e04f3d0237019
2016-02-08 18:10:34 -07:00
Paul Crowley
f7a0d007d2 Add new argument to unlock_user_key, fixing merge-caused error.
Change-Id: Ic51f375e500cd61bda926e3b039126a840ed89f0
2016-02-08 22:40:34 +00:00
Paul Crowley
5c025bd9a5 Merge "Password security for FBE disk encryption keys" into nyc-dev 2016-02-08 21:45:46 +00:00
Paul Crowley
0572080814 Password security for FBE disk encryption keys
Added a new call change_user_key which changes the way that disk
encryption keys are protected; a key can now be protected with a
combination of an auth token and a secret which is a hashed password.
Both of these are passed to unlock_user_key.

This change introduces a security bug, b/26948053, which must be fixed
before we ship.

Bug: 22950892
Change-Id: Iac1e45bb6f86f2af5c472c70a0fe3228b02115bf
2016-02-08 20:03:57 +00:00
Jeff Sharkey
0754a45539 Emulation fixes: mics dirs, recover after disable.
Add new misc directories to list of paths that we lock/unlock in
emulation mode.  When booting a device without native-FBE and without
emulation, make sure we "unlock" any emulated settings on user 0;
MountService handles this for secondary users later during boot.

Bug: 27069522
Change-Id: I15c7cf00a7231ce99b2e4e11a25106d7b87e70cc
2016-02-08 12:45:16 -07:00
Daichi Hirono
1ab7349e49 Merge "Add context mount option for appfuse." 2016-02-07 04:01:24 +00:00
Jeff Sharkey
47695b29af Allow callers to prepare CE/DE user storage.
Give callers the option of preparing CE and/or DE storage.  The
framework will only prepare CE storage after the CE keys have been
unlocked for that user.

When init is calling enablecrypto, kick off the work in a thread so
that we can make other calls back into vold without causing
deadlock.  Leaves blocking call intact for framework callers.

Clean up 'vdc' tool to send useful transaction numbers, and
actually watch for the matching result to come back.  This fixes
race conditions when there are multiple 'vdc' callers.

Also add other system and misc directories to match spec.

Bug: 25796509
Change-Id: Ie4f853db6e387916b845d2b5fb92925d743b063d
2016-02-05 13:03:52 -07:00
Daichi Hirono
1c419e000e Add context mount option for appfuse.
BUG=26147865

Change-Id: I1812c46d0f80eaea9a9a3fa944bc4d0126ae8ba1
2016-02-05 16:09:24 +09:00
Paul Lawrence
f10544df96 Remove unencrypted_properties
Change-Id: I5728f03dbde6621e410efcda1d93054915793407
2016-02-04 12:48:41 -08:00
Paul Lawrence
5a06a6481b Fix minor issues with previous change
New style logging
Remove set/get field from e4crypt
Save keys to temp file then rename

See https://googleplex-android-review.git.corp.google.com/#/c/858922/

Change-Id: I454c3f78489b491ffc1230a70dce64935e4e0f8a
2016-02-03 13:39:13 -08:00
Paul Lawrence
aec34dfb1d Use consistent method for device key
Change-Id: I420f548115c1b55e62b193c60d569fdda518af1a
2016-02-03 10:52:41 -08:00
Paul Lawrence
7b6b565fa0 Remove support for non-default root passwords in FBE
Change-Id: Ie179cb09f9f24382afd0fe0f3aa2a1ad943a7f5d
2016-02-02 12:47:52 -08:00
Daichi Hirono
dac436f1fe Merge "Mount appfuse in process namespace." 2016-02-02 10:14:29 +00:00
Daichi Hirono
10d34887b3 Mount appfuse in process namespace.
BUG=26148108

Change-Id: I2297fd227a4c607054e0403e73bd9c857f580a1c
2016-02-02 18:56:19 +09:00