Commit Graph

246 Commits

Author SHA1 Message Date
Sami Tolvanen 9af867e7bd fs_mgr_verity: fix verity_update_state for A/B devices
Use the correct device name when system is mounted as root, and
validate dm-verity status to avoid confusing it with dm-linear.

Bug: 29277442
Change-Id: I36e115189f9a9430bad4bf89f26a376bcb8e8168
2016-06-17 17:17:04 -07:00
Sami Tolvanen d6f5af35d5 Merge "fs_mgr: validate corrected signatures" into nyc-dev
am: eacbb824c9

* commit 'eacbb824c9ee2ccec9e1de641d03e7370888eabc':
  fs_mgr: validate corrected signatures

Change-Id: I3986a59d498a22769611216f5ed475f31332b2c9
2016-06-07 00:05:41 +00:00
Sami Tolvanen 830126637a fs_mgr: validate corrected signatures
If signature verification fails and we have an error corrected
signature available, attempt to verify that instead.

Needs changes from
  Ie913c21ba1d07d6df4c6feeb7226b2ec963f4d19

Bug: 28943429
Change-Id: I7d48701916fe430b17aa05acb120f22a1802733d
2016-06-06 13:54:00 -07:00
TreeHugger Robot 8024f8f9ea Merge "fs_mgr: update block device reference in verity metadata" into nyc-mr1-dev 2016-05-27 23:14:16 +00:00
Paul Lawrence 4e898a01fd Make file encryption type available
Bug: 28905864
Change-Id: I5f59f824fd92c32ff87aa730dc5c0f250564c0a9
2016-05-27 09:38:29 -07:00
Jeremy Compostella 32cabf25aa 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>

Bug: 28845874
2016-05-26 15:37:37 -07:00
Paul Lawrence 5b8a108ef5 Add fileencrypted=software/ice to fstab options
Bug: 28616054
Change-Id: If9dd4a17641412607ca4e4fed7f7dbf661ff0d25
2016-05-11 07:34:47 -07: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 e3a3288ddd resolve merge conflicts of 2857bd1 to nyc-dev
Change-Id: I3dc666cd44deb3e8438c2a482328f79e7a67e81e
2016-04-12 14:28:09 -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 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 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
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 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 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 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
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
Johan Redestig 67b3cad9a0 Switch to android::base::ReadFully
The if (read(...size) != size) pattern is unreliable, switch
to the android base ReadFully which wraps read in a loop.

Change-Id: I2324e4c45da3c9b53b18df6eb09ce69a6604b5d1
2015-10-13 14:49:38 +00:00
Elliott Hughes 246c18caf5 Switch fs_mgr_verity.c to C++.
This is the minimal change just to keep it building, and doesn't
attempt to clean up any of the code.

Change-Id: I975710322ae33d8946497df25bf85b2fe28976a4
2015-10-09 11:52:00 -07:00
Sami Tolvanen 049399e570 am ad2a5a89: Merge "fs_mgr: trigger dm-verity error handling for invalid signatures"
* commit 'ad2a5a89a680804b927fc123e952c5bb5e75b9c8':
  fs_mgr: trigger dm-verity error handling for invalid signatures
2015-09-30 20:04:51 +00:00
Sami Tolvanen 1ada14904d fs_mgr: trigger dm-verity error handling for invalid signatures
Currently, the device doesn't mount verified partitions if the
verity table signature is invalid, which usually means it fails to
boot. This change instead sets up dm-verity with an invalid root
hash and triggers device-specific error handling to recover from
the corruption.

Bug: 24256506
Change-Id: I6d693306fa0e7459c5500b028e433df61ecea6fb
(cherry picked from commit 47caa5c386)
2015-09-25 15:01:33 +01:00
Sami Tolvanen 4ae302af7d fs_mgr: trigger dm-verity error handling for invalid signatures
Currently, the device doesn't mount verified partitions if the
verity table signature is invalid, which usually means it fails to
boot. This change instead sets up dm-verity with an invalid root
hash and triggers device-specific error handling to recover from
the corruption.

Bug: 24256506
Change-Id: I6d693306fa0e7459c5500b028e433df61ecea6fb
(cherry picked from commit 47caa5c386)
2015-09-22 08:09:37 +00:00
David Zeuthen 77557e9091 am d906b297: Merge "fs_mgr: Error out if unable to determine slot_suffix"
* commit 'd906b2973b9f708b34d4df90a2496753f83199ec':
  fs_mgr: Error out if unable to determine slot_suffix
2015-09-14 15:39:49 +00:00
David Zeuthen d906b2973b Merge "fs_mgr: Error out if unable to determine slot_suffix" 2015-09-14 15:33:35 +00:00
David Zeuthen bd0231c96b fs_mgr: Error out if unable to determine slot_suffix
Instead of falling back to suffix _a, we now error out if neither the
kernel commandline nor the misc partition specifies the suffix. It's
cleaner this way.

Change-Id: I3f58928a664433504ebdf8d0ee05a319be5097cf
2015-09-11 12:53:18 -04:00
David Zeuthen 80364b94bc am 6ca11db7: Merge "fs_mgr: Fix ENOMEM behavior when dealing with slotselect."
* commit '6ca11db7b7dc5e141c767b38328c3838a3b90b60':
  fs_mgr: Fix ENOMEM behavior when dealing with slotselect.
2015-09-09 22:52:32 +00:00
David Zeuthen 744a8f87d9 fs_mgr: Fix ENOMEM behavior when dealing with slotselect.
Change-Id: I5460a8d31baa0d4817ff5fcbd9aac272071937f4
2015-09-09 18:03:13 -04:00
David Zeuthen 1c7060e055 resolved conflicts for d8eed7ff to stage-aosp-master
Change-Id: I7fb3ddc07d798f0f98075b9fab0bb88c88249455
2015-09-09 12:40:16 -04:00
David Zeuthen 227ef3c5d2 fs_mgr: Use slot_suffix field from bootloader_message.
This will make fs_mgr look in the misc partition for the A/B suffix to
use if one of more fstab entries is using the slotselect option and the
bootloader doesn't specify the suffix.

Change-Id: I24233195f60dd352bf8e7ac32b0d95dcd3323156
2015-09-08 15:54:32 -04:00
Daniel Rosenberg eb65ce0a24 resolved conflicts for merge of 7c4ed6af to stage-aosp-master
Change-Id: I52d0f66a6ad329daf19267be817c5a6d7118e7c4
2015-09-01 12:47:48 -07:00
Daniel Rosenberg 7c4ed6af79 Merge "fs_mgr: Add support for A/B partitions" 2015-09-01 19:24:09 +00:00
Daniel Rosenberg 8bb2f36abd fs_mgr: Add support for A/B partitions
Allow partitions to be marked as A/B partitions
using the slotselect flag in fstab. The partitions
can be identified by appending the correct suffix
to the block device listed in the fstab. The suffix
is provided by the bootloader through a command line
parameter or the device tree, and can be found in
ro.boot.slot_suffix or read from the boot_control HAL.

Change-Id: I6846d80e857f95bfb8f282f4ab81167394613bbe
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2015-08-31 15:18:05 -07:00
Yusuke Sato 2ef82cffad am d1b11a04: am e656be33: Merge "Add |opts| argument to android_fork_execvp_ext"
* commit 'd1b11a04903be74ba6a47307d8c3ef2731e3f4ab':
  Add |opts| argument to android_fork_execvp_ext
2015-08-19 22:31:08 +00:00