Commit Graph
8450 Commits
Author SHA1 Message Date
Tianjie Xu 58a27693b2 Force package installation with FUSE unless the package stores on device
The non-A/B package installation is subject to TOC/TOU flaw if the
attacker can switch the package in the middle of installation. And the
most pratical case is to store the package on an external device, e.g. a
sdcard, and swap the device in the middle.

To prevent that, we can adopt the same protection as used in sideloading
a package with FUSE. Specifically, when we install the package with FUSE,
we read the entire package to cryptographically verify its signature.
The hash for each transfer block is recorded in the memory (TOC), and
the subsequent reads (TOU) will be rejected upon dectecting a mismatch.

This CL forces the package installation with FUSE when the package stays
on a removable media.

Bug: 136498130
Test: Run bin/recovery --update_package with various paths;
and packages are installed from FUSE as expected

Change-Id: Ibc9b095036a2fa624e8edf6c347ed4f12aef072f
2019-10-16 11:35:17 -07:00
Tao Bao 5afb9a1f11 Merge "otautil: Factor out the utils that're private to recovery." am: c6fb9f9df5 am: dc717a5c2b am: 2772cfcb1a
am: ee516c147e

Change-Id: Icd4fe936cec72e654b7a4f3e733825bc14f39665
2019-10-02 16:11:50 -07:00
Tao Bao ee516c147e Merge "otautil: Factor out the utils that're private to recovery." am: c6fb9f9df5 am: dc717a5c2b
am: 2772cfcb1a

Change-Id: I89b1920d0cf6fddb7af1b0927adb6181e1204ab5
2019-10-02 15:27:54 -07:00
Tao Bao 2772cfcb1a Merge "otautil: Factor out the utils that're private to recovery." am: c6fb9f9df5
am: dc717a5c2b

Change-Id: Ib3c106d43f5d5a01c2a060703f760855ce135b11
2019-10-02 14:39:01 -07:00
Tao Bao dc717a5c2b Merge "otautil: Factor out the utils that're private to recovery."
am: c6fb9f9df5

Change-Id: Ib1f978bb79f317d64bfa053ed34cecaf97353ba9
2019-10-02 14:24:27 -07:00
Tao Bao c6fb9f9df5 Merge "otautil: Factor out the utils that're private to recovery." 2019-10-02 21:00:08 +00:00
Tao Bao e3f09a72f5 otautil: Factor out the utils that're private to recovery.
A number of utility functions are intended for serving recovery's own
use. Exposing them via libotautil (which is a static lib) would pass the
dependencies onto libotautil's users (e.g. recovery image, updater, host
simulator, device-specific recovery UI/updater extensions etc). This CL
finds a new home for the utils that are private to recovery.

Test: mmma bootable/recovery
Change-Id: I575e97ad099b85fe1c1c8c7c9458a5a43d4e11e1
2019-10-02 10:56:46 -07:00
Tao Bao 6ad8de9e2b Merge "otautil: Drop a few unneeded includes." am: 36f72131ff am: 7f9eb2e012 am: 78506ddf1a
am: f8d4db46a9

Change-Id: I4e6b15b372f70e584632aa32c04cb18f66616f91
2019-10-01 19:34:02 -07:00
Tao Bao f8d4db46a9 Merge "otautil: Drop a few unneeded includes." am: 36f72131ff am: 7f9eb2e012
am: 78506ddf1a

Change-Id: I37d895c5d35fb9c9435e5bed838c524fb0fa0f17
2019-10-01 19:28:00 -07:00
Tao Bao 78506ddf1a Merge "otautil: Drop a few unneeded includes." am: 36f72131ff
am: 7f9eb2e012

Change-Id: Ic094365bd36c3b466ec1904f1c6b16265f18f7da
2019-10-01 19:21:59 -07:00
Tao Bao 7f9eb2e012 Merge "otautil: Drop a few unneeded includes."
am: 36f72131ff

Change-Id: I7c358332c176fbc425490fd416f70ef35ac02cdb
2019-10-01 19:16:00 -07:00
Treehugger Robot 36f72131ff Merge "otautil: Drop a few unneeded includes." 2019-10-02 02:00:52 +00:00
Tao Bao f6ed376b20 otautil: Drop a few unneeded includes.
Test: mmma bootable/recovery
Change-Id: I6ed8f9eca7183f84537c770baaffddd22b6e9f28
2019-10-01 16:00:17 -07:00
Tao Bao e1bf5b2404 Merge changes I6c35d2e4,If16c3e19 am: c3f32b95e5 am: 48fb5e27a1 am: be4305fcd1
am: abdf3b93b6

Change-Id: Iaeca6c089344fccf0d4abe4bbc2f12ce3cfc1ba1
2019-10-01 14:58:33 -07:00
Tao Bao abdf3b93b6 Merge changes I6c35d2e4,If16c3e19 am: c3f32b95e5 am: 48fb5e27a1
am: be4305fcd1

Change-Id: I25bfe5dea51627e8d8d269860cff0b883636dc8e
2019-10-01 14:52:54 -07:00
Tao Bao be4305fcd1 Merge changes I6c35d2e4,If16c3e19 am: c3f32b95e5
am: 48fb5e27a1

Change-Id: I93102d773ec791d162cedfe050a9a8c5230a2bb4
2019-10-01 14:45:47 -07:00
Tao Bao 48fb5e27a1 Merge changes I6c35d2e4,If16c3e19
am: c3f32b95e5

Change-Id: I2d0f9cbe2ec6d3a1429c0c01204bb41ff7e7cb13
2019-10-01 14:40:41 -07:00
Tao Bao c3f32b95e5 Merge changes I6c35d2e4,If16c3e19
* changes:
  Move mounts.cpp from libotautil into libupdater.
  otautil: roots.cpp no longer needs 'mounts.h'.
2019-10-01 21:18:42 +00:00
Tao Bao d628cfc153 Move mounts.cpp from libotautil into libupdater.
All the active users of mounts.h now live in updater/.

Test: mmma bootable/recovery
Test: Run recovery_unit_test on taimen.
Test: Code search shows no reference to otautil/mounts.h in device dirs.
Change-Id: I6c35d2e403e92a0111102d00aa4773f4f524650e
2019-10-01 12:13:04 -07:00
Tao Bao 331e5c4c98 otautil: roots.cpp no longer needs 'mounts.h'.
Commit 0f339e27bb moved part of the mounts
implementation into libfs_mgr. As a result, otautil/roots.cpp no longer
depends on anything in the local otautil/mounts.h.

Test: mmma bootable/recovery
Change-Id: If16c3e19a62933358fb0002a10e8556a99f9d29a
2019-10-01 12:02:56 -07:00
Steven Moreland 46429152c0 Merge "Remove libhidltransport deps" am: e2ca8ba293 am: 3746d95338 am: 6e460f877a
am: 8465703b0b

Change-Id: I426a10f347882d00c29d9c6574e3ccbfc3c5f11b
2019-09-30 09:37:10 -07:00
Steven Moreland 8465703b0b Merge "Remove libhidltransport deps" am: e2ca8ba293 am: 3746d95338
am: 6e460f877a

Change-Id: I9134024f2a271d4eb3f4bdae57a2062da6c6cee9
2019-09-30 09:28:32 -07:00
Steven Moreland 6e460f877a Merge "Remove libhidltransport deps" am: e2ca8ba293
am: 3746d95338

Change-Id: Idd29edebb4ee16c00815b7a7557385faee262984
2019-09-30 09:22:00 -07:00
Steven Moreland 3746d95338 Merge "Remove libhidltransport deps"
am: e2ca8ba293

Change-Id: Ia3ea9dfe765659d34f44a3486ade41b06be6f7f0
2019-09-30 09:15:58 -07:00
Steven Moreland e2ca8ba293 Merge "Remove libhidltransport deps" 2019-09-30 15:56:03 +00:00
Tao Bao 5c9a49b9fd Merge "minadbd: Update README.md." am: ec734e5851 am: 79d93f9eee am: 586fed8db2
am: 2b27153d28

Change-Id: Ic8a9d0fc4f4495d5d5b70e7170f6257e1c04d3ac
2019-09-27 17:43:48 -07:00
Tao Bao 2b27153d28 Merge "minadbd: Update README.md." am: ec734e5851 am: 79d93f9eee
am: 586fed8db2

Change-Id: I994acdaabbca974c18dc144d9b20366bcb192688
2019-09-27 17:36:48 -07:00
Tao Bao 586fed8db2 Merge "minadbd: Update README.md." am: ec734e5851
am: 79d93f9eee

Change-Id: I5a415f079f66cf67af17c08a7f84d2ae68c36c70
2019-09-27 17:30:45 -07:00
Tao Bao 79d93f9eee Merge "minadbd: Update README.md."
am: ec734e5851

Change-Id: I133418ea66cce3fdb70c3baba7fa8d6b68beb740
2019-09-27 17:23:45 -07:00
Tao Bao ec734e5851 Merge "minadbd: Update README.md." 2019-09-27 23:47:06 +00:00
Tao Bao 0cc2c5b453 minadbd: Update README.md.
Test: N/A
Change-Id: I7f4648f2b357de7d9700e38552a0156d13c1bd0b
2019-09-27 13:17:16 -07:00
Tao Bao 9371caa8b0 Merge "minadbd: Export minadbd/types.h to libinstall." am: ffa9ffbd2b am: 74c405d87f am: e0cb5d5c1e
am: 86a39318cb

Change-Id: I84281d5179de162893853319eaca563db6ede09b
2019-09-26 16:32:32 -07:00
Tao Bao 86a39318cb Merge "minadbd: Export minadbd/types.h to libinstall." am: ffa9ffbd2b am: 74c405d87f
am: e0cb5d5c1e

Change-Id: Idd7bdcc93648d8de58f62d280aebd8d1dd00d449
2019-09-26 16:25:06 -07:00
Tao Bao e0cb5d5c1e Merge "minadbd: Export minadbd/types.h to libinstall." am: ffa9ffbd2b
am: 74c405d87f

Change-Id: I93f0cb7ea11664a69e76c703f95ee982ef9402da
2019-09-26 16:19:32 -07:00
Tao Bao 74c405d87f Merge "minadbd: Export minadbd/types.h to libinstall."
am: ffa9ffbd2b

Change-Id: I18571b1a696b02cab050b570bf36878e25a27462
2019-09-26 16:13:36 -07:00
Tao Bao ffa9ffbd2b Merge "minadbd: Export minadbd/types.h to libinstall." 2019-09-26 22:46:14 +00:00
Colin Cross a8efe45ef2 Merge "Use libcrypto_static instead of libcrypto" am: 4c4c7dc26b am: 617d01a9c1 am: 819a24d44e
am: c56c1e4480

Change-Id: I74a8273e7efce12c1de0983f3c8ba5e5d354b7b5
2019-09-26 08:19:58 -07:00
Colin Cross c56c1e4480 Merge "Use libcrypto_static instead of libcrypto" am: 4c4c7dc26b am: 617d01a9c1
am: 819a24d44e

Change-Id: I1c2606b711ec9743ff6484cbbfb7e64dc79b71d8
2019-09-26 08:07:09 -07:00
Colin Cross 819a24d44e Merge "Use libcrypto_static instead of libcrypto" am: 4c4c7dc26b
am: 617d01a9c1

Change-Id: I45e8687b462db7676efffd03323efbe1f273e9f2
2019-09-26 07:54:01 -07:00
Colin Cross 617d01a9c1 Merge "Use libcrypto_static instead of libcrypto"
am: 4c4c7dc26b

Change-Id: Ia77cc9f13f4807fd2276b332599a1b489cf4a9a6
2019-09-26 07:41:39 -07:00
Colin Cross 4c4c7dc26b Merge "Use libcrypto_static instead of libcrypto" 2019-09-26 14:32:33 +00:00
Tao Bao 3305d48b0b minadbd: Export minadbd/types.h to libinstall.
Test: mmma bootable/recovery
Change-Id: I503e942b23cc51024aa752c1eb3db5455a44a9d1
2019-09-26 00:04:11 -07:00
Steven Moreland ff9b62b781 Remove libhidltransport deps
Since this was combined into libhidlbase.

Bug: 135686713
Test: build only (libhidltransport is empty)
Change-Id: I253e50726967044714275ab995fb8a8a57bcde36
2019-09-25 15:12:30 -07:00
Bill Yi 4462180165 [automerger skipped] Import translations. DO NOT MERGE am: 92214baec2 -s ours am: 4a8558e9d8 -s ours
am: 4c70d5d02d -s ours
am skip reason: subject contains skip directive

Change-Id: Ic69c8b1808ba6956a5ca608fd0d031e098744fa9
2019-09-25 07:37:50 -07:00
Bill Yi 4c70d5d02d [automerger skipped] Import translations. DO NOT MERGE am: 92214baec2 -s ours
am: 4a8558e9d8 -s ours
am skip reason: subject contains skip directive

Change-Id: I94d0b4fdcab116c3d626def7833fa013506d7ecb
2019-09-25 07:27:27 -07:00
Bill Yi 4a8558e9d8 [automerger skipped] Import translations. DO NOT MERGE
am: 92214baec2 -s ours
am skip reason: subject contains skip directive

Change-Id: If3581390553ec30c8c59f54b12506cdff680c657
2019-09-25 07:21:27 -07:00
Bill Yi 92214baec2 Import translations. DO NOT MERGE
Change-Id: I18c2199dc9439d6013329d1f0eb40dd106618bfb
Auto-generated-cl: translation import
2019-09-24 14:36:40 -07:00
Tao Bao 3010e66ec4 Merge "applypatch: Add backup_source parameter to PatchPartition." am: 86b54dc493 am: 164f4759a2 am: 18185ae561
am: 6b60b35b4b

Change-Id: I1636bbf6a0e438b6817574ba9723f48b18f60b95
2019-09-23 16:47:54 -07:00
Tao Bao 6b60b35b4b Merge "applypatch: Add backup_source parameter to PatchPartition." am: 86b54dc493 am: 164f4759a2
am: 18185ae561

Change-Id: I313f427443d4d1c87990ffc6ebbb83e466b00588
2019-09-23 16:40:22 -07:00
Tao Bao 18185ae561 Merge "applypatch: Add backup_source parameter to PatchPartition." am: 86b54dc493
am: 164f4759a2

Change-Id: I0d4bc6a5ec15265889e6df57ebdb0ee7c4ed64ca
2019-09-23 16:33:00 -07:00