OSDN Git Service

android-x86/system-vold.git
9 years agoam fd7db732: (-s ours) DO NOT MERGE New ext4enc kernel switching from xattrs to ioctl
Paul Lawrence [Mon, 1 Jun 2015 15:28:39 +0000 (15:28 +0000)]
am fd7db732: (-s ours) DO NOT MERGE New ext4enc kernel switching from xattrs to ioctl

* commit 'fd7db732434eb41fda69a353053bcb7aab259529':
  DO NOT MERGE New ext4enc kernel switching from xattrs to ioctl

9 years agoam 731a7a24: (-s ours) DO NOT MERGE Securely encrypt the master key
Paul Lawrence [Mon, 1 Jun 2015 15:28:39 +0000 (15:28 +0000)]
am 731a7a24: (-s ours) DO NOT MERGE Securely encrypt the master key

* commit '731a7a242df6cc3441ac82b4f9521546fac5ac2d':
  DO NOT MERGE Securely encrypt the master key

9 years agoDO NOT MERGE New ext4enc kernel switching from xattrs to ioctl
Paul Lawrence [Fri, 10 Apr 2015 14:48:51 +0000 (07:48 -0700)]
DO NOT MERGE New ext4enc kernel switching from xattrs to ioctl

(cherrypicked from commit 5e7f0042318156ef39c1e4641613f3191ea85b4a)

This is one of three changes to enable this functionality:
  https://android-review.googlesource.com/#/c/146259/
  https://android-review.googlesource.com/#/c/146264/
  https://android-review.googlesource.com/#/c/146265/

Bug: 18151196

Change-Id: Iba5146b8be1e15050ae901e08b3aaa26d96dcf7e

9 years agoDO NOT MERGE Securely encrypt the master key
Paul Lawrence [Tue, 28 Apr 2015 22:14:15 +0000 (22:14 +0000)]
DO NOT MERGE Securely encrypt the master key

(cherry-picked from commit 707fd6c7cccc31c0ab0ec1a6ac8b6077c632fc35)

Move all key management into vold
Reuse vold's existing key management through the crypto footer
to manage the device wide keys.

Use ro.crypto.type flag to determine crypto type, which prevents
any issues when running in block encrypted mode, as well as speeding
up boot in block or no encryption.

This is one of four changes to enable this functionality:
  https://android-review.googlesource.com/#/c/148586/
  https://android-review.googlesource.com/#/c/148604/
  https://android-review.googlesource.com/#/c/148606/
  https://android-review.googlesource.com/#/c/148607/

Bug: 18151196

Change-Id: I3c68691717a61b5e1df76423ca0c02baff0dab98

9 years agoam 65427f1a: Offer debug flag to force default primary.
Jeff Sharkey [Wed, 20 May 2015 00:24:56 +0000 (00:24 +0000)]
am 65427f1a: Offer debug flag to force default primary.

* commit '65427f1a805ed2b8ee65a30ecf6ea8b14fe1e02b':
  Offer debug flag to force default primary.

9 years agoOffer debug flag to force default primary.
Jeff Sharkey [Tue, 19 May 2015 22:54:15 +0000 (15:54 -0700)]
Offer debug flag to force default primary.

Useful for transforming a secondary SD card slot into a primary SD
card slot without doing a completely different lunch target.

$ adb shell stop
$ adb shell setprop vold.debug.default_primary 1
$ adb shell setprop ro.vold.primary_physical 1
$ adb shell setprop ctl.restart vold
$ adb shell start

Bug: 21017105
Change-Id: I45aac7ab3bb4c5ac3e0140572844883823fc3e4f

9 years agoam 721e5807: Fully sync filesystem before time measurements.
Jeff Sharkey [Tue, 19 May 2015 22:51:16 +0000 (22:51 +0000)]
am 721e5807: Fully sync filesystem before time measurements.

* commit '721e5807ed28c7630c0359212cdc0544a9918aa1':
  Fully sync filesystem before time measurements.

9 years agoFully sync filesystem before time measurements.
Jeff Sharkey [Tue, 19 May 2015 18:20:48 +0000 (11:20 -0700)]
Fully sync filesystem before time measurements.

Also drop unneeded SCR register logging.

Bug: 21172095
Change-Id: I17c5aae2edc0eb7144ab38701f90a1fd54e119da

9 years agoam 4351c9a0: Merge "Don\'t use TEMP_FAILURE_RETRY on close in vold." into mnc-dev
Elliott Hughes [Sat, 16 May 2015 03:03:46 +0000 (03:03 +0000)]
am 4351c9a0: Merge "Don\'t use TEMP_FAILURE_RETRY on close in vold." into mnc-dev

* commit '4351c9a08be1d95607e2e5d431692198d60b7d94':
  Don't use TEMP_FAILURE_RETRY on close in vold.

9 years agoMerge "Don't use TEMP_FAILURE_RETRY on close in vold." into mnc-dev
Elliott Hughes [Sat, 16 May 2015 02:42:30 +0000 (02:42 +0000)]
Merge "Don't use TEMP_FAILURE_RETRY on close in vold." into mnc-dev

9 years agoDon't use TEMP_FAILURE_RETRY on close in vold.
Elliott Hughes [Sat, 16 May 2015 01:34:24 +0000 (18:34 -0700)]
Don't use TEMP_FAILURE_RETRY on close in vold.

Bug: http://b/20501816
Change-Id: Ieecce9304539c250ed1728252b8c2c09d29afd7f

9 years agoam 5a6bfca1: Initial pass at storage benchmarks.
Jeff Sharkey [Fri, 15 May 2015 22:22:33 +0000 (22:22 +0000)]
am 5a6bfca1: Initial pass at storage benchmarks.

* commit '5a6bfca1638760b87cf64c5ffb48ff3557cc0563':
  Initial pass at storage benchmarks.

9 years agoInitial pass at storage benchmarks.
Jeff Sharkey [Fri, 15 May 2015 03:33:55 +0000 (20:33 -0700)]
Initial pass at storage benchmarks.

Now that we're offering to store private app data on adopted storage
devices, the performance of those devices is much more important to
overall user experience.

To help set user expectations, this change offers to execute a
real-world benchmark on a storage device, returning a metric that can
be used to compare internal and external storage.  The benchmark is
generated from the strace-instrumented storage access patterns of
typical apps.

A typical device completes the benchmark in under two seconds on
internal storage, a UHS-3 SD card is even faster (!), but a very slow
Class 4 SD card takes about 30 seconds to complete, giving us a clear
signal.

The measured benchmark numbers are logged along with information
about the storage device, such as manufacturer, model, etc.  Card
serial numbers are scrubbed from output.

Bug: 21172095
Change-Id: I9b2713dafdfdfcf5d97bf1bc21841f39409a7e54

9 years agoam e44a41a1: Communicate if we have adoptable disks.
Jeff Sharkey [Wed, 13 May 2015 21:19:18 +0000 (21:19 +0000)]
am e44a41a1: Communicate if we have adoptable disks.

* commit 'e44a41a17b5c2d488442d7805b08231f4b327aca':
  Communicate if we have adoptable disks.

9 years agoCommunicate if we have adoptable disks.
Jeff Sharkey [Wed, 13 May 2015 20:53:07 +0000 (13:53 -0700)]
Communicate if we have adoptable disks.

Bug: 19993667
Change-Id: I3c3dddab157a11038f7160d24d53e728bde2194f

9 years agoam 8d15cb98: Report internal path for public volumes.
Jeff Sharkey [Wed, 13 May 2015 19:58:49 +0000 (19:58 +0000)]
am 8d15cb98: Report internal path for public volumes.

* commit '8d15cb9828f89709243b33c610b429694788c05d':
  Report internal path for public volumes.

9 years agoReport internal path for public volumes.
Jeff Sharkey [Wed, 13 May 2015 19:36:48 +0000 (12:36 -0700)]
Report internal path for public volumes.

Used by framework to bypass FUSE daemon overhead in some cases.

Bug: 21017105
Change-Id: I2f3ae70607417fc4cd2c970cb17cf3afa2f42613

9 years agoresolved conflicts for merge of 9df68a13 to mnc-dev-plus-aosp
Kenny Root [Wed, 13 May 2015 16:35:54 +0000 (09:35 -0700)]
resolved conflicts for merge of 9df68a13 to mnc-dev-plus-aosp

Change-Id: I5c72c27ec055195d84c58d0699b46d3942c29dde

9 years agoam eb0c05ce: Merge "Break key installation into its own function so we can install...
Paul Crowley [Wed, 13 May 2015 15:21:43 +0000 (15:21 +0000)]
am eb0c05ce: Merge "Break key installation into its own function so we can install non-master keys."

* commit 'eb0c05ced4264f095b309b17f56babf49b3696dd':
  Break key installation into its own function so we can install non-master keys.

9 years agoMerge "Add vold commands for setting up per-user encrypted user directories"
Paul Crowley [Wed, 13 May 2015 09:20:22 +0000 (09:20 +0000)]
Merge "Add vold commands for setting up per-user encrypted user directories"

9 years agoAdd vold commands for setting up per-user encrypted user
Paul Crowley [Wed, 6 May 2015 14:04:43 +0000 (15:04 +0100)]
Add vold commands for setting up per-user encrypted user
directories

Bug: 19704432
Change-Id: I15980eed8e4960ca270cf0f8db4e480a8c2ca832

9 years agoMerge "Break key installation into its own function so we can install non-master...
Paul Crowley [Tue, 12 May 2015 12:59:55 +0000 (12:59 +0000)]
Merge "Break key installation into its own function so we can install non-master keys."

9 years agoBreak key installation into its own function so we can install
Paul Crowley [Wed, 6 May 2015 12:38:53 +0000 (13:38 +0100)]
Break key installation into its own function so we can install
non-master keys.

Bug: 19704432
Change-Id: I5050d0e79c37f2a1366260e3f892d5b59e77b14b

9 years agoam 86ddbbf4: Merge "Delete password as per block encryption"
Paul Lawrence [Thu, 7 May 2015 16:16:12 +0000 (16:16 +0000)]
am 86ddbbf4: Merge "Delete password as per block encryption"

* commit '86ddbbf4143daa721b84f0f253022d19d61b6fe3':
  Delete password as per block encryption

9 years agoMerge "Delete password as per block encryption"
Paul Lawrence [Thu, 7 May 2015 15:26:35 +0000 (15:26 +0000)]
Merge "Delete password as per block encryption"

9 years agoam 42696d97: Merge "Make vdc a C++ file as a base for further improvement."
Paul Crowley [Wed, 6 May 2015 23:48:01 +0000 (23:48 +0000)]
am 42696d97: Merge "Make vdc a C++ file as a base for further improvement."

* commit '42696d97ce138fa5e7a1380b3841250549acb615':
  Make vdc a C++ file as a base for further improvement.

9 years agoam eae7fc77: Merge "Fix problem that reading/writing crypto footers wasn\'t identity"
Paul Lawrence [Wed, 6 May 2015 23:47:54 +0000 (23:47 +0000)]
am eae7fc77: Merge "Fix problem that reading/writing crypto footers wasn\'t identity"

* commit 'eae7fc77b60962c9384b31e0f98d14724731ce88':
  Fix problem that reading/writing crypto footers wasn't identity

9 years agoam b32ebf30: Merge "Retry unmounts in ext4 encryption"
Paul Lawrence [Wed, 6 May 2015 23:47:54 +0000 (23:47 +0000)]
am b32ebf30: Merge "Retry unmounts in ext4 encryption"

* commit 'b32ebf308a95ffa937d9b9a36417cdea70add0e5':
  Retry unmounts in ext4 encryption

9 years agoam 4571383c: Merge "Use default key permissions for ext4enc"
Paul Lawrence [Wed, 6 May 2015 22:45:32 +0000 (22:45 +0000)]
am 4571383c: Merge "Use default key permissions for ext4enc"

* commit '4571383cbf711df21d99529448277966e7ffb11e':
  Use default key permissions for ext4enc

9 years agoam 0f29aec5: Merge "Simplify password checking logic"
Paul Lawrence [Wed, 6 May 2015 22:44:59 +0000 (22:44 +0000)]
am 0f29aec5: Merge "Simplify password checking logic"

* commit '0f29aec5af81083a558eeae7ec348b4f4fa9fb0e':
  Simplify password checking logic

9 years agoDelete password as per block encryption
Paul Lawrence [Wed, 6 May 2015 20:53:43 +0000 (13:53 -0700)]
Delete password as per block encryption

Bug: 18151196
Change-Id: Iee0f932c61ff4a309dc2861725b24bf976adb4c7

9 years agoMerge "Make vdc a C++ file as a base for further improvement."
Paul Crowley [Wed, 6 May 2015 15:57:10 +0000 (15:57 +0000)]
Merge "Make vdc a C++ file as a base for further improvement."

9 years agoMerge "Fix problem that reading/writing crypto footers wasn't identity"
Paul Lawrence [Wed, 6 May 2015 14:08:25 +0000 (14:08 +0000)]
Merge "Fix problem that reading/writing crypto footers wasn't identity"

9 years agoMerge "Retry unmounts in ext4 encryption"
Paul Lawrence [Wed, 6 May 2015 14:08:05 +0000 (14:08 +0000)]
Merge "Retry unmounts in ext4 encryption"

9 years agoMake vdc a C++ file as a base for further improvement.
Paul Crowley [Wed, 6 May 2015 10:27:44 +0000 (11:27 +0100)]
Make vdc a C++ file as a base for further improvement.

Bug: 19704432
Change-Id: I784e8a91d3b0f4d6cd0dc668e9e55d0290f768e8

9 years agoFix problem that reading/writing crypto footers wasn't identity
Paul Lawrence [Tue, 5 May 2015 22:58:27 +0000 (15:58 -0700)]
Fix problem that reading/writing crypto footers wasn't identity

Bug: 18151196
Change-Id: Ideef6bcdbccf068a64ed3e042be50c4837a373f8

9 years agoRetry unmounts in ext4 encryption
Paul Lawrence [Tue, 5 May 2015 21:28:25 +0000 (14:28 -0700)]
Retry unmounts in ext4 encryption

Bug: 18151196
Change-Id: I52ca23b2ce3adcff44bd003d4a12243a0bd6ac34

9 years agoMerge "Use default key permissions for ext4enc"
Paul Lawrence [Tue, 5 May 2015 20:18:35 +0000 (20:18 +0000)]
Merge "Use default key permissions for ext4enc"

9 years agoUse default key permissions for ext4enc
Paul Lawrence [Tue, 5 May 2015 18:09:07 +0000 (11:09 -0700)]
Use default key permissions for ext4enc

As per discussion default permissions are the correct ones.
Note that since we use logon keys, they cannot be read outside
the kernel.

Note also that we limit who can read/write keys in selinux policy.

Bug: 18151196
Change-Id: Icc916f430a70eff22e6b74c20ec361c8f3789c1c

9 years agoMerge "Simplify password checking logic"
Paul Lawrence [Tue, 5 May 2015 14:13:04 +0000 (14:13 +0000)]
Merge "Simplify password checking logic"

9 years agoSimplify password checking logic
Paul Lawrence [Mon, 4 May 2015 22:48:24 +0000 (15:48 -0700)]
Simplify password checking logic

Bug: 18151196
Change-Id: I07ffde534dee7d1032149cfcbaa1a61c5246d759

9 years agoam babba576: Merge "Enable properties in ext4enc"
Paul Lawrence [Fri, 1 May 2015 15:34:27 +0000 (15:34 +0000)]
am babba576: Merge "Enable properties in ext4enc"

* commit 'babba576ba0d1b6fb69c849848c8b01c8b585e24':
  Enable properties in ext4enc

9 years agoMerge "Enable properties in ext4enc"
Paul Lawrence [Fri, 1 May 2015 15:13:38 +0000 (15:13 +0000)]
Merge "Enable properties in ext4enc"

9 years agoEnable properties in ext4enc
Paul Lawrence [Wed, 15 Apr 2015 21:12:00 +0000 (14:12 -0700)]
Enable properties in ext4enc

Enables OwnerInfo and pattern suppression

Bug: 18151196

Change-Id: I46144e16cb00319deeb5492ab82c67f5dd43d6d3

9 years agoam 744a7aa5: Merge "Check password is correct by checking hash"
Paul Lawrence [Thu, 30 Apr 2015 17:44:45 +0000 (17:44 +0000)]
am 744a7aa5: Merge "Check password is correct by checking hash"

* commit '744a7aa54b551bbdaa0edbd806e2a125801eb1c4':
  Check password is correct by checking hash

9 years agoam 74e6349d: Merge "Fix signed issue with hex conversion." into mnc-dev
Jeff Sharkey [Thu, 30 Apr 2015 17:34:00 +0000 (17:34 +0000)]
am 74e6349d: Merge "Fix signed issue with hex conversion." into mnc-dev

* commit '74e6349d8e4dde988c121e9674472908cc8c748d':
  Fix signed issue with hex conversion.

9 years agoMerge "Check password is correct by checking hash"
Paul Lawrence [Thu, 30 Apr 2015 17:20:08 +0000 (17:20 +0000)]
Merge "Check password is correct by checking hash"

9 years agoMerge "Fix signed issue with hex conversion." into mnc-dev
Jeff Sharkey [Thu, 30 Apr 2015 17:07:15 +0000 (17:07 +0000)]
Merge "Fix signed issue with hex conversion." into mnc-dev

9 years agoam d7399147: Merge "New ext4enc kernel switching from xattrs to ioctl"
Paul Lawrence [Thu, 30 Apr 2015 16:52:30 +0000 (16:52 +0000)]
am d7399147: Merge "New ext4enc kernel switching from xattrs to ioctl"

* commit 'd7399147685a6b54c2d899bc84aa9839eaa07c71':
  New ext4enc kernel switching from xattrs to ioctl

9 years agoCheck password is correct by checking hash
Paul Lawrence [Tue, 14 Apr 2015 22:26:29 +0000 (15:26 -0700)]
Check password is correct by checking hash

Handle failures gracefully

Change-Id: Ifb6da8c11a86c50fb11964c18cc1be1326461f78

9 years agoMerge "New ext4enc kernel switching from xattrs to ioctl"
Paul Lawrence [Thu, 30 Apr 2015 16:28:52 +0000 (16:28 +0000)]
Merge "New ext4enc kernel switching from xattrs to ioctl"

9 years agoNew ext4enc kernel switching from xattrs to ioctl
Paul Lawrence [Fri, 10 Apr 2015 14:48:51 +0000 (07:48 -0700)]
New ext4enc kernel switching from xattrs to ioctl

This is one of three changes to enable this functionality:
  https://android-review.googlesource.com/#/c/146259/
  https://android-review.googlesource.com/#/c/146264/
  https://android-review.googlesource.com/#/c/146265/

Bug: 18151196

Change-Id: Iba5146b8be1e15050ae901e08b3aaa26d96dcf7e

9 years agoam 1bfb375f: Update primary symlinks after mounting.
Jeff Sharkey [Thu, 30 Apr 2015 01:01:37 +0000 (01:01 +0000)]
am 1bfb375f: Update primary symlinks after mounting.

* commit '1bfb375f77c093a8e16bef4ddeab2681ca126d56':
  Update primary symlinks after mounting.

9 years agoUpdate primary symlinks after mounting.
Jeff Sharkey [Wed, 29 Apr 2015 22:22:23 +0000 (15:22 -0700)]
Update primary symlinks after mounting.

Since otherwise we might have a stale path.

Bug: 19993667
Change-Id: I099e3dc0c5aa9ab6820cded4f2ae7fd6bf18ea40

9 years agoFix signed issue with hex conversion.
Jeff Sharkey [Wed, 29 Apr 2015 22:57:48 +0000 (15:57 -0700)]
Fix signed issue with hex conversion.

Change-Id: Ia11c689c373f41b2a63bc84151eb16f7c7b9d155

9 years agoMerge commit 'c3e4cc29' into manualmerge
Paul Lawrence [Wed, 29 Apr 2015 16:47:44 +0000 (09:47 -0700)]
Merge commit 'c3e4cc29' into manualmerge

Change-Id: I1f6feaf743e0b9a62fe212af3cd9dd16abefeb00

9 years agoMerge "Securely encrypt the master key"
Paul Lawrence [Wed, 29 Apr 2015 16:24:38 +0000 (16:24 +0000)]
Merge "Securely encrypt the master key"

9 years agoam b0667870: Property to enable debugging.
Jeff Sharkey [Wed, 29 Apr 2015 16:23:04 +0000 (16:23 +0000)]
am b0667870: Property to enable debugging.

* commit 'b0667870ff036c598486a8ec87ad2bbe321b2a20':
  Property to enable debugging.

9 years agoProperty to enable debugging.
Jeff Sharkey [Wed, 29 Apr 2015 15:57:18 +0000 (08:57 -0700)]
Property to enable debugging.

Bug: 19993667
Change-Id: Ie226e06edcb426caca2dbc97d2d5d60ae948c85e

9 years agoam ba6747f1: Scan failure still means we finished scan.
Jeff Sharkey [Wed, 29 Apr 2015 05:35:43 +0000 (05:35 +0000)]
am ba6747f1: Scan failure still means we finished scan.

* commit 'ba6747f119811032b258cf3c6334a4d0f9b675bf':
  Scan failure still means we finished scan.

9 years agoScan failure still means we finished scan.
Jeff Sharkey [Wed, 29 Apr 2015 04:17:43 +0000 (21:17 -0700)]
Scan failure still means we finished scan.

Bug: 19993667
Change-Id: If6a79391e34b652b2ba4e6df40a8e712f7a2e172

9 years agoSecurely encrypt the master key
Paul Lawrence [Tue, 28 Apr 2015 22:14:15 +0000 (22:14 +0000)]
Securely encrypt the master key

Move all key management into vold
Reuse vold's existing key management through the crypto footer
to manage the device wide keys.

Use ro.crypto.type flag to determine crypto type, which prevents
any issues when running in block encrypted mode, as well as speeding
up boot in block or no encryption.

This is one of four changes to enable this functionality:
  https://android-review.googlesource.com/#/c/148586/
  https://android-review.googlesource.com/#/c/148604/
  https://android-review.googlesource.com/#/c/148606/
  https://android-review.googlesource.com/#/c/148607/

Bug: 18151196

Change-Id: I3c68691717a61b5e1df76423ca0c02baff0dab98

9 years agoresolved conflicts for merge of bf9dcad7 to mnc-dev-plus-aosp
Paul Lawrence [Tue, 28 Apr 2015 21:18:31 +0000 (14:18 -0700)]
resolved conflicts for merge of bf9dcad7 to mnc-dev-plus-aosp

Change-Id: Ic0d4ed7e6c83ad857e2a4a198d069b73fcf399e6

9 years agoMerge "Revert "Securely encrypt the master key""
Paul Lawrence [Tue, 28 Apr 2015 19:16:57 +0000 (19:16 +0000)]
Merge "Revert "Securely encrypt the master key""

9 years agoRevert "Securely encrypt the master key"
Paul Lawrence [Tue, 28 Apr 2015 19:16:46 +0000 (19:16 +0000)]
Revert "Securely encrypt the master key"

This reverts commit 7053e9cd5ebbbb783bf4140381090e6bd0caa740.

Change-Id: I77ed4dbdff8643c80629d2126cb29f85c24c7b43

9 years agoresolved conflicts for merge of 86138731 to mnc-dev-plus-aosp
Paul Lawrence [Mon, 27 Apr 2015 21:14:36 +0000 (14:14 -0700)]
resolved conflicts for merge of 86138731 to mnc-dev-plus-aosp

Change-Id: I89203aa1665bb42f9a98fd8b94b933e8406dde02

9 years agoMerge "Securely encrypt the master key"
Paul Lawrence [Mon, 27 Apr 2015 20:08:57 +0000 (20:08 +0000)]
Merge "Securely encrypt the master key"

9 years agoSecurely encrypt the master key
Paul Lawrence [Thu, 26 Mar 2015 15:32:18 +0000 (08:32 -0700)]
Securely encrypt the master key

Move all key management into vold
Reuse vold's existing key management through the crypto footer
to manage the device wide keys

This is one of four changes to enable this functionality:
  https://android-review.googlesource.com/#/c/144586/
  https://android-review.googlesource.com/#/c/144663/
  https://android-review.googlesource.com/#/c/144672/
  https://android-review.googlesource.com/#/c/144673/

Bug: 18151196
Change-Id: I9a162b90afe5f46a4ff15b3878e2ab503795425e

9 years agoam 85c7c08e: am d5aa67cc: Merge "Wait for completion of device mapping in mountObb"
Elliott Hughes [Sat, 25 Apr 2015 17:24:04 +0000 (17:24 +0000)]
am 85c7c08e: am d5aa67cc: Merge "Wait for completion of device mapping in mountObb"

* commit '85c7c08e2511509a306c3a5b202ceda922f5f2b5':
  Wait for completion of device mapping in mountObb

9 years agoam d5aa67cc: Merge "Wait for completion of device mapping in mountObb"
Elliott Hughes [Sat, 25 Apr 2015 17:02:47 +0000 (17:02 +0000)]
am d5aa67cc: Merge "Wait for completion of device mapping in mountObb"

* commit 'd5aa67cc53bd10ba851179d634a7ed649958e5ee':
  Wait for completion of device mapping in mountObb

9 years agoMerge "Wait for completion of device mapping in mountObb"
Elliott Hughes [Sat, 25 Apr 2015 16:42:37 +0000 (16:42 +0000)]
Merge "Wait for completion of device mapping in mountObb"

9 years agoWait for completion of device mapping in mountObb
yoshiyuki hama [Wed, 28 Jan 2015 07:37:23 +0000 (16:37 +0900)]
Wait for completion of device mapping in mountObb

The VolumeManager::mountObb() creates a mapping between
a loopback device and a dm device. However the device-mapper
carries it out asynchronously, so there is a possibility that
Vold accesses to the dm device which is being built. Added
waiting for completion of the mapping in that function, like
mountAsec().

To verify install FrameworksCoreTests.apk and do:

  adb shell am instrument -r -w -e class android.os.storage.\
  StorageManagerIntegrationTest#testMountTwoEncryptedObb \
  com.android.frameworks.coretests/android.test.\
  InstrumentationTestRunner

Change-Id: If42f4b7494bb2f8a8b72d106ad84b3e3bf91fd9b

9 years agoMigrate primary external storage.
Jeff Sharkey [Fri, 24 Apr 2015 23:00:03 +0000 (16:00 -0700)]
Migrate primary external storage.

When requested, kick off a thread that will migrate storage contents
between two locations.  This is performed in several steps that
also interact with the framework:

1. Take old and new volumes offline during migration
2. Wipe new location clean (10% of progress)
3. Copy files from old to new (60% of progress)
4. Inform framework that move was successful so it can persist
5. Wipe old location clean (15% of progress)

Derives a hacky progress estimate by using a rough proxy of free
disk space changes while a cp/rm is taking place.

Add new internal path for direct access to volumes to bypass any
FUSE emulation overhead, and send it to framework.  Remove mutex
around various exec calls since setexeccon() is already per-thread.

Bug: 19993667
Change-Id: Ibcb4f6fe0126d05b2365f316f53e71dc3e79a2b8

9 years agoWider volume mutation lock, move force adoptable.
Jeff Sharkey [Tue, 21 Apr 2015 19:14:17 +0000 (12:14 -0700)]
Wider volume mutation lock, move force adoptable.

We eventually should move back to per-disk locks, but use a giant
lock to keep development rolling forward.  Also move force adoptable
flag to framework since, since encrypted devices don't have persisted
properties loaded early during boot.

Bug: 19993667
Change-Id: Ifa3016ef41b038f8f71fc30bc81596cfd21dcd2a

9 years agoHandle *ALL* the SCSI disks!
Jeff Sharkey [Sun, 19 Apr 2015 22:55:42 +0000 (15:55 -0700)]
Handle *ALL* the SCSI disks!

Bug: 19993667
Change-Id: I47099c262686127f82dd376570d49cf0ad119842

9 years agoNotify when disk scan finished.
Jeff Sharkey [Sun, 19 Apr 2015 21:57:55 +0000 (14:57 -0700)]
Notify when disk scan finished.

Bug: 19993667
Change-Id: I20dc183a35c11b5b4ba6139e690929b9c279b830

9 years agoSwitch logging to system log, persistable prop.
Jeff Sharkey [Sat, 18 Apr 2015 23:15:10 +0000 (16:15 -0700)]
Switch logging to system log, persistable prop.

Use system log for more durable log history.  Also accept persistable
version of flag to force adoptability.

Bug: 19993667
Change-Id: Icdf36799e26038e9a8e2bdaca276d97b22ba3941

9 years agoVolumes know parent disks; unsupported disks.
Jeff Sharkey [Sat, 18 Apr 2015 00:35:20 +0000 (17:35 -0700)]
Volumes know parent disks; unsupported disks.

This is cleaner and more direct than the reverse of having the disk
publish child volume membership.  Rename state constants to match
public API.  Add state representing bad removal.  Make it clear that
volume flags are related to mounting.

Send new unsupported disk event when we finish scanning an entire
disk and have no meaningful volumes.

Bug: 19993667
Change-Id: I08a91452ff561171a484d1da5745293ec893aec0

9 years agoLock while partitioning.
Jeff Sharkey [Wed, 15 Apr 2015 06:14:23 +0000 (23:14 -0700)]
Lock while partitioning.

Otherwise we get really excited and trip over ourselves while
partitions are still being created.

Bug: 19993667
Change-Id: I034e56b3063a71d73f9311a945c05ea2ae255f7d

9 years agoDon't be picky about zap status.
Jeff Sharkey [Wed, 15 Apr 2015 05:22:34 +0000 (22:22 -0700)]
Don't be picky about zap status.

Bug: 19993667
Change-Id: Id125d9252bf7130516c0ec619d5f067fea24d560

9 years agoFix destroy ordering bug; add debug flag.
Jeff Sharkey [Tue, 14 Apr 2015 23:45:18 +0000 (16:45 -0700)]
Fix destroy ordering bug; add debug flag.

Bug: 19993667
Change-Id: Ib15e79a94a185843dace35fea7daaea866120f87

9 years agoRemember to tear down ASEC bind mount.
Jeff Sharkey [Mon, 13 Apr 2015 04:50:32 +0000 (21:50 -0700)]
Remember to tear down ASEC bind mount.

Bug: 19993667
Change-Id: I17093f0f9abe8762e5ee4f38ce99f9024e419dfc

9 years agoEmulated volumes above private volumes.
Jeff Sharkey [Sun, 12 Apr 2015 23:03:33 +0000 (16:03 -0700)]
Emulated volumes above private volumes.

When a private volume is mounted, create an emulated volume above it
hosted at the /media path on that device.  That emulated volume is
automatically torn down when unmounting the private volume.

Add "removed" state for volume, which signals to framework that
media has left the building, send when the volume is destroyed.

Bug: 19993667
Change-Id: I1f82b51de578ac5cfcc5d7b9a6fb44f6f25c775c

9 years agoExclusive exec() path, format after partition.
Jeff Sharkey [Thu, 9 Apr 2015 04:07:21 +0000 (21:07 -0700)]
Exclusive exec() path, format after partition.

Sadly setexeccon() is process global, so we need to carefully ensure
that all exec() are mutually exclusive to avoid transitioning into
unwanted domains.  Also, because we have several threads floating
around, we need to guard all our FDs with O_CLOEXEC.

Format all newly created volumes immediately after partitioning,
but silence all events emitted from those volumes to prevent the
framework from getting all excited.  Unify all notify events under a
single codepath to make them easy to silence.

Sent SIGINT before escalating to SIGTERM when unmounting.

Bug: 19993667
Change-Id: Idc6c806afc7919a004a93e2240b42884f6b52d6b

9 years agoam 959de99a: am f8c905e0: Merge "Add dependency on libsquashfs_utils due to fs_mgr...
Mohamad Ayyash [Tue, 7 Apr 2015 18:44:08 +0000 (18:44 +0000)]
am 959de99a: am f8c905e0: Merge "Add dependency on libsquashfs_utils due to fs_mgr dependency"

* commit '959de99af47dec9ed7a3499ce57e4097be399d7d':
  Add dependency on libsquashfs_utils due to fs_mgr dependency

9 years agoam f8c905e0: Merge "Add dependency on libsquashfs_utils due to fs_mgr dependency"
Mohamad Ayyash [Tue, 7 Apr 2015 18:13:19 +0000 (18:13 +0000)]
am f8c905e0: Merge "Add dependency on libsquashfs_utils due to fs_mgr dependency"

* commit 'f8c905e043cbeb76bf0d88dff5b5676f4e00f71c':
  Add dependency on libsquashfs_utils due to fs_mgr dependency

9 years agoMerge "Add dependency on libsquashfs_utils due to fs_mgr dependency"
Mohamad Ayyash [Tue, 7 Apr 2015 18:00:52 +0000 (18:00 +0000)]
Merge "Add dependency on libsquashfs_utils due to fs_mgr dependency"

9 years agoAdd dependency on libsquashfs_utils due to fs_mgr dependency
Mohamad Ayyash [Tue, 7 Apr 2015 01:15:53 +0000 (18:15 -0700)]
Add dependency on libsquashfs_utils due to fs_mgr dependency

Change-Id: I894d18c2086a6532194f478853a9837eb4b6fc09
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
9 years agoUpdates for expanded storage.
Jeff Sharkey [Mon, 6 Apr 2015 21:08:45 +0000 (14:08 -0700)]
Updates for expanded storage.

Mount private volumes at /mnt/expand, which is where we have new
SELinux policy waiting for us.  Also ensure that foundational
directories are ready when mounting.

Create local fs_prepare_dir() wrapper that sets SELinux context
based on path, avoiding the need for a later restorecon.

Use UUID as directory name for public volumes.  Wait a few seconds
before issuing first signal when force unmounting.

Bug: 19993667
Change-Id: If22595380faaae321705b06c87d877419620da48

9 years agoAdd back "unmountable" volume state.
Jeff Sharkey [Sun, 5 Apr 2015 04:38:59 +0000 (21:38 -0700)]
Add back "unmountable" volume state.

Also automatically unmount when format is requested.

Bug: 19993667
Change-Id: I2c81b7ccc9d69df61d7ae4df1e8224c02f260044

9 years agoRemove unused code.
Jeff Sharkey [Thu, 2 Apr 2015 06:32:18 +0000 (23:32 -0700)]
Remove unused code.

Bug: 19993667
Change-Id: I1f6519655c5a366eca25e2329e1bf95d81b3bf8c

9 years agoSome CLOEXEC love.
Jeff Sharkey [Thu, 2 Apr 2015 06:07:19 +0000 (23:07 -0700)]
Some CLOEXEC love.

Bug: 19993667
Change-Id: If8c0b346820f30c6a7dac495f935be17d677ffcc

9 years agoDifferent blkid and fsck execution domains.
Jeff Sharkey [Wed, 1 Apr 2015 18:54:32 +0000 (11:54 -0700)]
Different blkid and fsck execution domains.

vold works with two broad classes of block devices: untrusted devices
that come in from the wild, and trusted devices like PrivateVolume
which are encrypted.

When running blkid and fsck, we pick which SELinux execution domain
to use based on which class the device belongs to.

Bug: 19993667
Change-Id: I2695f028710a4863f0c3b2ed6da437f466401272

9 years agoSupport for private (adopted) volumes.
Jeff Sharkey [Tue, 31 Mar 2015 17:35:33 +0000 (10:35 -0700)]
Support for private (adopted) volumes.

This adds support for private volumes which is just a filesystem
wrapped in a dm-crypt layer.  For now we're using the exact same
configuration as internal encryption (aes-cbc-essiv:sha256), but we
don't store any key material on the removable media.  Instead, we
store the key on internal storage, and use the GPT partition GUID
to identify which key should be used.

This means that private external storage is effectively as secure as
the internal storage of the device.  That is, if the internal storage
is encrypted, then our external storage key is also encrypted.

When partitioning disks, we now support a "private" mode which has
a PrivateVolume partition, and a currently unused 16MB metadata
partition reserved for future use.  It also supports a "mixed" mode
which creates both a PublicVolume and PrivateVolume on the same
disk.  Mixed mode is currently experimental.

For now, just add ext4 support to PrivateVolume; we'll look at f2fs
in a future change.  Add VolumeBase lifecycle for setting up crypto
mappings, and extract blkid logic into shared method.  Sprinkle some
more "static" around the cryptfs code to improve invariants.

Bug: 19993667
Change-Id: Ibd1df6250735b706959a1eb9d9f7219ea85912a0

9 years agoFix 64 bit builds.
Jeff Sharkey [Tue, 31 Mar 2015 04:22:07 +0000 (21:22 -0700)]
Fix 64 bit builds.

Change-Id: I4e30ecff3c29d0f8351c6f43de1c979c8c792fab

9 years agoProgress towards dynamic storage support.
Jeff Sharkey [Fri, 13 Mar 2015 23:09:20 +0000 (16:09 -0700)]
Progress towards dynamic storage support.

Wire up new Disk and VolumeBase objects and events to start replacing
older DirectVolume code.  Use filesystem UUID as visible PublicVolume
name to be more deterministic.

When starting, create DiskSource instances based on fstab, and watch
for kernel devices to appear.  Turn matching devices into Disk
objects, scan for partitions, and create any relevant VolumeBase
objects.  Broadcast all of these events towards userspace so the
framework can decide what to mount.

Keep track of the primary VolumeBase, and update the new per-user
/storage/self/primary symlink for all started users.

Provide a reset command that framework uses to start from a known
state when runtime is restarted.  When vold is unexpectedly killed,
try recovering by unmounting everything under /mnt and /storage
before moving forward.

Remove UMS sharing support for now, since no current devices support
it; MTP is the recommended solution going forward because it offers
better multi-user support.

Switch killProcessesWithOpenFiles() to directly take signal.  Fix
one SOCK_CLOEXEC bug, but SELinux says there are more lurking.

Bug: 19993667
Change-Id: I2dad1303aa4667ec14c52f774e2a28b3c1c1ff6d

9 years agoam 8a0fde27: am e9623fed: Merge "Fixed type mismatch for ioctl(BLKGETSIZE)"
Elliott Hughes [Mon, 30 Mar 2015 21:28:10 +0000 (21:28 +0000)]
am 8a0fde27: am e9623fed: Merge "Fixed type mismatch for ioctl(BLKGETSIZE)"

* commit '8a0fde272be430f66b2e5db6236aa732d2ba6efc':
  Fixed type mismatch for ioctl(BLKGETSIZE)

9 years agoam e9623fed: Merge "Fixed type mismatch for ioctl(BLKGETSIZE)"
Elliott Hughes [Mon, 30 Mar 2015 21:14:49 +0000 (21:14 +0000)]
am e9623fed: Merge "Fixed type mismatch for ioctl(BLKGETSIZE)"

* commit 'e9623fede7a89d61952f983f0c0a294fc3563c9c':
  Fixed type mismatch for ioctl(BLKGETSIZE)

9 years agoMerge "Fixed type mismatch for ioctl(BLKGETSIZE)"
Elliott Hughes [Mon, 30 Mar 2015 21:03:04 +0000 (21:03 +0000)]
Merge "Fixed type mismatch for ioctl(BLKGETSIZE)"

9 years agoFixed type mismatch for ioctl(BLKGETSIZE)
Hiroaki Miyazawa [Wed, 4 Feb 2015 04:29:15 +0000 (13:29 +0900)]
Fixed type mismatch for ioctl(BLKGETSIZE)

ioctl(BLKGETSIZE) expects unsigned long
(8 bytes on 64 bit environment).

This is fixing fails in android.os.storage.StorageManagerIntegrationTest
(in FrameworkCoreTests).

To verify, install FrameworksCoreTests.apk and do:

adb shell am instrument -r -w -e class android.os.storage.\
StorageManagerIntegrationTest#testMountSingleEncryptedObb \
com.android.frameworks.coretests/android.test.InstrumentationTestRunner

Change-Id: Ib6d5c7490c02521c93f107c35ad0aac49f6a3f1a