Commit graph

262 commits

Author SHA1 Message Date
Jeff Vander Stoep
c1b985435f resolve merge conflicts of adadb7d to nyc-dev-plus-aosp
Change-Id: I03bcd3f68f49160ccaa820b3983ca9a88adf6c57
2016-06-01 11:46:42 -07:00
Treehugger Robot
58ea31cc90 Merge "fs_mgr: pass sehandle to ext4 format routine" 2016-06-01 17:30:09 +00:00
Chih-Hung Hsieh
5fb629a212 resolve merge conflicts of e845c04 to nyc-dev-plus-aosp
Change-Id: I423f722dcc3821b9be52613d68640b49cbac70a6
2016-05-27 16:04:21 -07:00
Chih-Hung Hsieh
c713bce901 Fix misc-macro-parentheses warnings in init and other core modules.
Bug: 28705665
Change-Id: Ice67cebb8c42538f8fb9cf1756678f41a9d68a31
2016-05-18 18:11:49 -07:00
Badhri Jagan Sridharan
348f3590f0 Merge "fs_mgr: update block device reference in verity metadata" am: 4cefb91611
am: 30c9aed0be

* commit '30c9aed0becc77a31a2b86b8683db5630fc95024':
  fs_mgr: update block device reference in verity metadata

Change-Id: I2d024cefaa15b62cb6b0ffa6fe57c904304c5160
2016-05-16 18:13:45 +00:00
Jeremy Compostella
dfd2478bd1 fs_mgr: update block device reference in verity metadata
The dm-verity metadata contains the block device path that is given to
the dm-android-verity driver.  If the device is using slot A/B, this
path is missing the slot suffix.

This patch makes fs_mgr replace all the block device path reference
with the one including the active slot suffix.

Change-Id: Ib624d0d18b12a8a287cac7f15605a2e0fb7c97c6
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
2016-05-16 16:37:24 +00:00
William Roberts
875476d8ed fs_mgr: pass sehandle to ext4 format routine
When fs_mgr_do_format() is executed, fs_mgr creates a new
blank data file system. However, that filesystem is not
labeled and causes some unlabeled denials on early boot.

Example Denial:
avc: denied { search } for pid=2535 comm="logd" name="/" dev="mmcblk0p9" ino=2 scontext=u:r:logd:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=1

To correct this, pass sehandle to the internal ext4 routine.
This way the ext4 filesystem will be labeled at creation and
the root inode will have a label.

Change-Id: Ieeecaa8bbc258e6d743d281dd956bdaca98b365f
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-05-13 11:28:24 -07:00
Matthew Bouyack
2e7620594e Merge "If we fail to format a blank partition, try recovery" into nyc-dev
am: 6846d22629

* commit '6846d22629e7bf9d53006d4f40c9c5f81b2b45f0':
  If we fail to format a blank partition, try recovery

Change-Id: I6879f99f6901b24a3a51a35c3fc629c49bb64091
2016-05-03 23:22:58 +00:00
Matthew Bouyack
9c59cbcf37 If we fail to format a blank partition, try recovery
Bug: 28303663

Change-Id: Iab802997dcd2a4416417228c92362518c7f1a82f
2016-05-03 10:01:03 -07:00
Daniel Rosenberg
e99283103b Merge "Add nofail fstab option" 2016-04-14 00:12:44 +00:00
Elliott Hughes
9c4a0e0216 Merge changes from topic \'boringssl_conversion\' am: 52eb93c
am: 0781351

* commit '07813516502d12cfeabef94838e916c0cf4f3b46':
  Switch fs_mgr and adb to libcrypto_utils.
  Add libcrypto_utils.

Change-Id: Ib50abd66d546a2b2c7a1249043e1b39c2147c674
2016-04-12 23:22:11 +00:00
Mattias Nissler
097b6bbc76 Switch fs_mgr and adb to libcrypto_utils.
Update code and dependencies to use BoringSSL + libcrypto_utils
instead of mincrypt.

Change-Id: Ic75164bd50c84b81b6310e27a67d4b3c174984f9
2016-04-12 23:04:11 +00:00
Daniel Rosenberg
dde4e5a071 resolve merge conflicts of 2857bd1 to nyc-dev
am: e3a3288

* commit 'e3a3288dddcde8c180dfe2935335ca3c475e37a2':
  Add nofail fstab option

Change-Id: I42d1d4862f9f630999f2479b9a9b9e14431fe8bf
2016-04-12 22:46:28 +00:00
Daniel Rosenberg
e3a3288ddd resolve merge conflicts of 2857bd1 to nyc-dev
Change-Id: I3dc666cd44deb3e8438c2a482328f79e7a67e81e
2016-04-12 14:28:09 -07:00
Daniel Rosenberg
de551ffee9 Add nofail fstab option
This option allows fs_mgr to ignore mount errors on an optional
partition to allow booting to continue.

Bug: 28071890
Change-Id: I71a2b3c1c573297cab18884b4c4bd7c27ced2901
2016-04-12 14:06:25 -07:00
Daniel Rosenberg
d38e3c522c Add nofail fstab option
This option allows fs_mgr to ignore mount errors on an optional
partition to allow booting to continue.

Bug: 28071890
Change-Id: I71a2b3c1c573297cab18884b4c4bd7c27ced2901
2016-04-07 20:37:31 -07:00
Robb Glasser
2f5d1da43e Merge "Revert "Revert "HACK: Run e2fsck with -f""" into nyc-dev
am: a1a8a82

* commit 'a1a8a82e5dd177b84ab78cbb1630c10057bab80c':
  Revert "Revert "HACK: Run e2fsck with -f""

Change-Id: Ifc6b20404e5057093dbe5aa5f1bf82d0d6f568a7
2016-04-05 20:00:46 +00:00
Robb Glasser
3fb176cb46 Revert "Revert "HACK: Run e2fsck with -f""
bug:28013112

This reverts commit 07068de789.

Change-Id: I1e507f2244a2960e79524ef2aef427f25d79f905
2016-04-05 18:43:37 +00:00
Paul Lawrence
131aabdf0e Merge "Revert "HACK: Run e2fsck with -f"" into nyc-dev
am: dc6893c

* commit 'dc6893ce9fda33740e7c59b6a49433e03da9a66b':
  Revert "HACK: Run e2fsck with -f"

Change-Id: I8943c573dea631e4324b3b6a621dc791c55f667b
2016-03-30 20:55:19 +00:00
Paul Lawrence
07068de789 Revert "HACK: Run e2fsck with -f"
This reverts commit 2cd762d932.

This change adds 12 seconds or so to boot times - we need to revert it
and see if we can find a proper fix to the original problem if it is
still occurring.

Bug: 27849759
Change-Id: Ib3692e436c08468a51529f256f2ce5e9ccd2d35d
2016-03-29 18:02:33 +00:00
George Burgess IV
02f689e11a Merge "Cleanup uses of sprintf so we can deprecate it." am: 2c5b89a64a
am: 3368bdebba

* commit '3368bdebba02316710bafc5bce120eec388365fb':
  Cleanup uses of sprintf so we can deprecate it.
2016-03-08 07:41:39 +00:00
George Burgess IV
e7aa2b2c83 Cleanup uses of sprintf so we can deprecate it.
Also cleans up two instances of open() with useless mode params, and
changes a few uses of snprintf to use sizeof(buffer) instead of
hardcoded buffer sizes.

Change-Id: If11591003d910c995e72ad8f75afd072c255a3c5
2016-03-07 18:40:40 -08:00
Paul Lawrence
bdd5908766 Merge "Distinguish between unencrypted and unencryptable" into nyc-dev
am: 72d2e06f4e

* commit '72d2e06f4e10d0d11526eb9bb09a3ef23302729c':
  Distinguish between unencrypted and unencryptable
2016-03-07 16:56:51 +00:00
Paul Lawrence
1098aacde4 Distinguish between unencrypted and unencryptable
Set ro.crypto.state flag to unencrypted and unsupported accordingly

Bug: 18002358
Change-Id: I1f88ce9704c5505d7b63256e2ebe5f8441c79ad0
2016-03-04 15:52:33 -08:00
Mohamad Ayyash
70c04ec218 Merge "Revert "Revert "Update make_ext4fs_internal param-list to match new implementation""" into nyc-dev
am: 5dac46ac94

* commit '5dac46ac944da477c1abcba70cf424064ca233fe':
  Revert "Revert "Update make_ext4fs_internal param-list to match new implementation""
2016-02-23 23:13:46 +00:00
Mohamad Ayyash
73b64aa8f8 Revert "Revert "Update make_ext4fs_internal param-list to match new implementation""
This reverts commit 527cc0b7a4.

Change-Id: I0c5705ae6e0188797b910df3ada614cacf1d835e
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-02-19 20:40:22 -08:00
Mohamad Ayyash
33748928da Revert "Update make_ext4fs_internal param-list to match new implementation"
am: 527cc0b7a4

* commit '527cc0b7a4d2a72f38d6f956a03864391f5562f1':
  Revert "Update make_ext4fs_internal param-list to match new implementation"
2016-02-19 21:23:33 +00:00
Mohamad Ayyash
527cc0b7a4 Revert "Update make_ext4fs_internal param-list to match new implementation"
This reverts commit 6d94dfee45.

Change-Id: Iec0832740e321e31a78a31d5358542d2ed4455fa
2016-02-19 21:16:38 +00:00
Mohamad Ayyash
8e9878f3e6 Update make_ext4fs_internal param-list to match new implementation
am: 6d94dfee45

* commit '6d94dfee451dccc07c9c158da97f9393ac4e0a83':
  Update make_ext4fs_internal param-list to match new implementation
2016-02-19 19:38:48 +00:00
Mohamad Ayyash
6d94dfee45 Update make_ext4fs_internal param-list to match new implementation
BUG: 26839493
Change-Id: I4cd316ebc91457e2ec31c0e8b116798d9f94a223
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-02-19 18:34:59 +00:00
Elliott Hughes
008ed76b22 Merge "fs_mgr: BLKGETSIZE causes memory corruption"
am: 9c9818374e

* commit '9c9818374eb4a867c5edc97be65ad0b682302435':
  fs_mgr: BLKGETSIZE causes memory corruption
2016-02-16 20:45:43 +00:00
Keith Mok
d93adf55df fs_mgr: BLKGETSIZE causes memory corruption
BLKGETSIZE return unsigned long sector size,
but unsigned long is of 8 bytes in 64 bits system.
Passing an integar value will causes stack corruption.
Use BLKGETSIZE64 instead.

Change-Id: I60323e51c6692d4405cf2ed015ab4216c1591f68
2016-02-16 09:51:00 -08:00
Paul Crowley
c31f1f3f6e Check for breadcrumbs only where relevant
Don't look for breadcrumb files like convert_fde unless the fstab
flags indicate we actually care whether they are present or absent.

Bug: 26989796
Change-Id: I3cde9896b22fc6f5a4b63dc3f97ac4e3588b5568
2016-02-09 21:05:01 +00:00
Paul Lawrence
69080180ce Remove code to handle non-default file encryption
Change-Id: I6d986853929c0237c0d958329b8e9aab47907a00
2016-02-02 10:34:40 -08:00
Sami Tolvanen
dce48bc06e Merge "fs_mgr: support upstream dm-verity without error correction" am: 907ec7daa7
am: 2d4ec2e663

* commit '2d4ec2e6634ae3d55836167ba9ae02fb5703fe33':
  fs_mgr: support upstream dm-verity without error correction
2015-12-10 15:43:10 -08:00
Sami Tolvanen
6401e61a6a Merge "Set up dm-verity in EIO mode instead of logging mode" am: 0d1214c68e
am: 42a86f8d1e

* commit '42a86f8d1e918356e86d4eb3fb2444a8c42d25ff':
  Set up dm-verity in EIO mode instead of logging mode
2015-12-10 15:43:02 -08:00
Sami Tolvanen
907ec7daa7 Merge "fs_mgr: support upstream dm-verity without error correction" 2015-12-10 20:13:02 +00:00
Sami Tolvanen
0d1214c68e Merge "Set up dm-verity in EIO mode instead of logging mode" 2015-12-10 20:12:49 +00:00
Sami Tolvanen
ff980d22d1 fs_mgr: support upstream dm-verity without error correction
Set up dm-verity even if kernel configuration doesn't have
CONFIG_DM_VERITY_FEC set. Fall back to the always safe EIO
mode if dm-verity doesn't support feature arguments.

Bug: 21893453
Change-Id: I4812bd74801c0abc8da479230f48b752858f9cd8
2015-12-10 01:01:29 +00:00
Elliott Hughes
ef119a14b8 Merge "Track rename of base/ to android-base/." am: 912ed3d8ca am: e2a9563be1
am: 3608ee5e90

* commit '3608ee5e903689ea7c433587be664649689816e1':
  Track rename of base/ to android-base/.
2015-12-07 23:59:44 +00:00
Elliott Hughes
4f71319df0 Track rename of base/ to android-base/.
Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
2015-12-04 22:00:26 -08:00
Daniel Rosenberg
2cd762d932 HACK: Run e2fsck with -f
Until we figure out what is causing the filesystem
created on hammerhead's factory reset to be invalid,
force e2fsck to run

Bug:24763183
Change-Id: Iff015097ab8c22084f485ce77d5a4c47442bcf7c
2015-12-04 13:13:51 -08:00
Sami Tolvanen
90f52df257 Set up dm-verity in EIO mode instead of logging mode
If the device is corrupted, set up dm-verity in EIO mode instead of
logging mode. This prevents corrupted blocks from being returned to
user space. Note that restart mode is used by default and a warning
will be displayed to the user after corruption is first detected.

Bug: 19277516
Change-Id: I38966d73eb814836bc34b4bad1192583e5010b36
2015-12-02 14:38:01 +00:00
Paul Lawrence
8d6338340d Encrypt on reboot
Change encryption to happen after a reboot, not before. This
removes the problem whereby if data cannot be unmounted, we cannot
encrypt.

Bug: 25426629

Change-Id: Icb2ec6cf330b5cc45b7e944c858a314f983fcaa4
2015-11-23 09:09:38 -08:00
Paul Lawrence
aecb1e2b5b Respect breadcrumb to convert to file encryption
Change-Id: I4fec97e8c36fc68907a05e6a052d28955ce31a4e
2015-11-13 07:58:57 -08:00
Paul Lawrence
b262d6864e Add developer option to convert from FDE to FBE
This set of changes adds the screen that offers this conversion,
and the plumbing so the option is only available on suitable
devices.

It does not implement the conversion mechanism.

Change-Id: Idbe5ef5d5fad197cc8187e1b288c57feef2c2c0b
2015-11-04 05:09:32 -08:00
Sami Tolvanen
25b230c62c fs_mgr: set partition.*.verified property even without state
Set properties on verity_update_state even if verity state management
is not used.

Bug: 24865045
Change-Id: Ic68a9e1a230c959eeb2a769260ff7d8e100cb1e1
(cherry picked from 0eb0516665678aec7712d88b51c96aaf8b312060)
2015-10-30 13:14:38 +00:00
Sami Tolvanen
99e3a927e8 Error correction: Use libfec in fs_mgr
Use libfec to read and parse verity metadata to protect against data
corruption.

Bug: 21893453
Change-Id: I3a3543e0d999316707302b3be8735a7133d22946
2015-10-14 22:12:04 +01:00
Sami Tolvanen
0923453462 Revert "Error correction: Use libfec in fs_mgr"
This reverts commit 3de3a0f351.

Change-Id: I1f121cbc4431b8d8ff146eab29832a8dda1eb8ba
2015-10-14 19:46:16 +00:00
Sami Tolvanen
3de3a0f351 Error correction: Use libfec in fs_mgr
Use libfec to read and parse verity metadata to protect against data
corruption.

Bug: 21893453
Change-Id: Ieee6a1441e2f68148ba635235216e36c69b13db1
2015-10-13 15:53:25 +01:00