Commit graph

1267 commits

Author SHA1 Message Date
Paul Lawrence
6abe6831b5 Stop dropping caches now we have kernel fix
Only merge once

https://partner-android-review.googlesource.com/#/c/619829/1

has been merged into kernel.

Bug: 28779973
Change-Id: Icef78d1e4381e89e07797c36f6f650033d313557
2016-06-22 09:24:51 -07:00
Paul Lawrence
6e41059734 Set encryption mode in mode file
Bug: 28905864
Change-Id: Ie2a5c3e029075d53a86ef3afb7fe364c16d8d52b
2016-05-27 09:40:37 -07:00
Paul Lawrence
3ae29e7740 Revert "Add fileencrypted=software/ice to fstab options"
This reverts commit 01f1bc7254.

Bug: 28905864
Change-Id: I489f5d073530438829038630af7af6b2a5cbdbbe
2016-05-23 15:05:51 -07:00
Paul Crowley
8fd77a05cc Two phases to set the password for disk encryption
am: a363036b44

* commit 'a363036b44f7f140aa9a943578f56abff5880a60':
  Two phases to set the password for disk encryption

Change-Id: Ia28823079d8c0bda220238339f28095b234a0ae5
2016-05-18 22:59:57 +00:00
Paul Crowley
a363036b44 Two phases to set the password for disk encryption
Revert "Revert "Two phases to set the password for disk encryption""

This reverts commit d402389290.

In addition, fix the bug in the original commit.

Bug: 28154455
Bug: 28694324
Change-Id: I885f1d73e739416347c135d79979941c2bbdbe62
2016-05-17 15:23:06 -07:00
Paul Lawrence
01f1bc7254 Add fileencrypted=software/ice to fstab options
Bug: 28616054
Change-Id: If3fddd62f069c7e3e8369a1db68e69c390059d63
2016-05-11 08:56:31 -07:00
Paul Crowley
44ddebaac0 Merge "e4crypt_is_native has been moved into system/extras." into nyc-dev
am: cfa03d4a4c

* commit 'cfa03d4a4c53acf41dca2c41a2efd00de06043bb':
  e4crypt_is_native has been moved into system/extras.

Change-Id: I345475c44fb2d8812a25c9f2195c748cddc55bfe
2016-05-10 22:17:38 +00:00
Paul Crowley
cfa03d4a4c Merge "e4crypt_is_native has been moved into system/extras." into nyc-dev 2016-05-10 22:12:49 +00:00
Paul Crowley
26642bf7bf Revert "Two phases to set the password for disk encryption"
am: d402389290

* commit 'd402389290eeef86be7eb9241e20fdd125d44eb1':
  Revert "Two phases to set the password for disk encryption"

Change-Id: I53a3804fc7bff9c99840aeee36fc4b7ff8e46ac1
2016-05-10 21:19:47 +00:00
Paul Crowley
d402389290 Revert "Two phases to set the password for disk encryption"
This reverts commit 92c5eeb467.

Bug: 28694324
Change-Id: Ibbbaff287f4dd28f4a13e122a3617987a8875a44
2016-05-10 20:36:43 +00:00
Paul Crowley
4d2d5244d6 e4crypt_is_native has been moved into system/extras.
Bug: 28318405
Change-Id: Id962764cf7fb5f58b769bf99aeb6d3d69cb66991
2016-05-10 08:43:07 -07:00
Paul Crowley
4e44272c3d Two phases to set the password for disk encryption
am: 92c5eeb467

* commit '92c5eeb46779f0fa1c9e6db6b0d632d960cbb2e4':
  Two phases to set the password for disk encryption

Change-Id: I82c1cfa2874ac4709e42f5c2047c832cbcaccb91
2016-05-09 21:51:33 +00:00
Paul Crowley
92c5eeb467 Two phases to set the password for disk encryption
In one phase, we make the new password work, and in the second we make
it the only one which works ("fixation"). This means that we can set
the password in Gatekeeper between these two phases, and a crash
doesn't break things. Unlocking a user automatically fixates the
presented credential.

Bug: 28154455
Change-Id: I54623c8652f0c9f72dd60388a7dc0ab2d48e81c7
2016-05-06 11:09:39 -07:00
Paul Lawrence
235e78b9ae Merge "Drop caches after installing key policy to avoid cache clashes" into nyc-mr1-dev 2016-04-29 16:32:02 +00:00
Paul Lawrence
85e3d8cd50 Drop caches after installing key policy to avoid cache clashes
Note that this is an ugly workaround for a kernel bug.

Bug: 28373400
Change-Id: Iec1ae53f4e18f06e41e8cf1fcc3ab03fc9848632
2016-04-29 07:58:21 -07:00
Paul Crowley
26335ed378 Use a longer timeout on the disk encryption keys
am: b3de337

* commit 'b3de337acd7ad07de1ed30d24fdfd628d1d8590b':
  Use a longer timeout on the disk encryption keys

Change-Id: Ieadec9da13383361ac76bf6b79ecea948965a1d9
2016-04-27 22:53:18 +00:00
Paul Crowley
b3de337acd Use a longer timeout on the disk encryption keys
Avoid a timeout error by extending the time allowed between getting
the auth token and decrypting the key from five to thirty seconds.

Bug: 28398766
Change-Id: I1dbb9e0e33707e7de4c1720ad1b8e153c77094b2
2016-04-27 12:58:41 -07:00
John Cormie
a54cd8739c Merge "Unmount public sdcard filesystems before killing the fuse process." into nyc-dev
am: a4330be

* commit 'a4330beb482c3b5decf6a6fc966e5589210130eb':
  Unmount public sdcard filesystems before killing the fuse process.

Change-Id: I294d46bb27fb6d8ac83f1041e849fd366134b6ee
2016-04-25 23:57:06 +00:00
John Cormie
a4330beb48 Merge "Unmount public sdcard filesystems before killing the fuse process." into nyc-dev 2016-04-25 23:49:28 +00:00
Martijn Coenen
05f1d813cc Merge "Move vold (and sdcard childs) to foreground cpuset." into nyc-dev
am: 47ff14a

* commit '47ff14ad38ec96fef25b2bbe1b3365fcd97bc8f5':
  Move vold (and sdcard childs) to foreground cpuset.

Change-Id: I2d539472902f0f2ce33bbfe767f93b9bf91856ce
2016-04-25 18:03:42 +00:00
Martijn Coenen
47ff14ad38 Merge "Move vold (and sdcard childs) to foreground cpuset." into nyc-dev 2016-04-25 17:46:02 +00:00
John Cormie
25cc7e3c33 Unmount public sdcard filesystems before killing the fuse process.
Avoids ENOTCONN during eject for sdcard users.

Change-Id: I7b89ccaad4bb7af3639dc0b702168030a2f88366
Bug: 28268676
2016-04-19 22:34:52 +00:00
Paul Lawrence
c771d20860 Merge "Don\'t start defaultcrypto twice" into nyc-dev
am: 0264d8f

* commit '0264d8ff7c2d5a2cdb4faaf9a3493103138373dd':
  Don't start defaultcrypto twice

Change-Id: I39951628d41f656901658cd82a56298ef9f663ec
2016-04-19 14:47:13 +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
30b0a1fcdd Consistent creation/destruction of user data.
am: be70c9a

* commit 'be70c9ae2251ac8f3bfbbe75146f8c533d64e01b':
  Consistent creation/destruction of user data.

Change-Id: I55f4fe88a8c02d019fa92028e6ad358fc0f75aeb
2016-04-18 19:59:55 +00: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