Commit graph

67555 commits

Author SHA1 Message Date
David Anderson
4067c7e1a7 libsnapshot: Ensure dm-user devices are destroyed after a merge.
Also, make sure snapuserd has closed its references. This is preventing
the merge from completing until a reboot.

Bug: N/A
Test: vts_libsnapshot_test
Change-Id: Iba18f887bdb262c630ec44461871e19fe64dbf3c
2021-01-11 22:42:11 -08:00
David Anderson
2147cc5675 libsnapshot: Fix tests for mapping snapshots in first-stage init.
These tests are failing due to a missing WaitForFile call. Simplify
setting this up by adding a helper.

Bug: N/A
Test: vts_libsnapshot_test
Change-Id: Ic2afa74f72c7e364695233120b2327bae904882a
2021-01-11 22:42:09 -08:00
SzuWei Lin
478868826f Deprecate /factory
After Treblized, AOSP do not handle /factory folder. Also, AOSP
does not mount any partition to /factory. /factory has no possibility
to have any content. For factory purpose, it can be implemented in
vendor.

Bug: 177280838
Test: na
Change-Id: I0a2537336c2ef1efbad3e4f9e876aeaa607bc737
2021-01-12 12:18:39 +08:00
Akilesh Kailash
d2ad50103e libsnapshot:snapuserd: Handle un-aligned IO request
If the requested IO is not 4k aligned and spans
between two COW Operations, then we will have
to split the IO as we need to read the partial
buffers from two COW operations.

BUG: 176918488
Test: cow_snapuserd_test - Data verification with unaligned IO
      Full OTA on cuttlefish
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Icf6801e1767112b92cb7991808860f119adebda2
2021-01-12 01:09:21 +00:00
Yifan Hong
d86f5b99f8 Remove healthd.
It is replaced by health HIDL HAL 2.0. Devices launching
with Android P and above must always have health HAL 2.0,
so health HAL is no longer needed for Android S.

Test: TH
Bug: 171260613
Change-Id: I7d94af36a880d7c658e879a3986924a786e58de9
2021-01-11 15:44:58 -08:00
Peter Collingbourne
942e5eef44 Merge "Remove ANDROID_EXPERIMENTAL_MTE." 2021-01-11 20:42:44 +00:00
Matthew Maurer
b026acb71e Merge changes I595cb4ee,Ie8623a70
* changes:
  trusty: tipc-test: Use dma_buf rather than memfd
  trusty: tipc-test: Test multi-page support
2021-01-11 20:12:22 +00:00
Peter Collingbourne
cd27807bfe Remove ANDROID_EXPERIMENTAL_MTE.
Now that the feature guarded by this flag has landed in Linux 5.10
we no longer need the flag, so we can remove it.

Bug: 135772972
Change-Id: I02fa50848cbd0486c23c8a229bb8f1ab5dd5a56f
2021-01-11 10:55:51 -08:00
Matthew Maurer
8ca6ab0161 trusty: tipc-test: Use dma_buf rather than memfd
Test: tipc-test -t send-fd
Bug: 117221195
Change-Id: I595cb4ee5fc24d8cafc9a3e706346139a974d674
2021-01-11 10:23:46 -08:00
Matthew Maurer
b6e795513b trusty: tipc-test: Test multi-page support
Test: tipc-test -t send-fd
Bug: 117221195
Change-Id: Ie8623a70f6935ede6bb5e9dd1a7945a7e356d854
2021-01-11 10:23:30 -08:00
David Anderson
491e4da372 init: Add an selinux transition for snapuserd.
With compressed VAB updates, it is not possible to mount /system without
first running snapuserd, which is the userspace component to the dm-user
kernel module. This poses a problem because as soon as selinux
enforcement is enabled, snapuserd (running in a kernel context) does not
have access to read and decompress the underlying system partition.

To account for this, we split SelinuxInitialize into multiple steps:

First, sepolicy is read into an in-memory string.

Second, the device-mapper tables for all snapshots are rebuilt. This
flushes any pending reads and creates new dm-user devices. The original
kernel-privileged snapuserd is then killed.

Third, sepolicy is loaded from the in-memory string.

Fourth, we re-launch snapuserd and connect it to the newly created
dm-user devices. As part of this step we restorecon device-mapper
devices and /dev/block/by-name/super, since the new snapuserd is in a
limited context.

Finally, we set enforcing mode.

This sequence ensures that snapuserd has appropriate privileges with a
minimal number of permissive audits.

Bug: 173476209
Test: full OTA with VABC applies and boots
Change-Id: Ie4e0f5166b01c31a6f337afc26fc58b96217604e
2021-01-08 16:39:51 -08:00
Gavin Corkery
09494764ae Merge "Add /metadata/watchdog" 2021-01-08 08:20:45 +00:00
SzuWei Lin
0061d4da01 Make ro.product.cpu.abilist* to be fetched dynamically
Basically, ro.product.cpu.abilist* are defined by
ro.vendor.cpu.abilist*. And they can be overried by
ro.odm.cpu.abilist* and ro.product.cpu.abilist*.
ro.system.cpu.abilist* are for fallback if others are no defined.

Bug: 176520383
Test: check the result by flashing aosp_arm64-userdebug on
Test: aosp_blueline-user and aosp_blueline-user hacked by
Test: 64-bits-only
Change-Id: I01ae01af099a4ec8fe3d4525edecc233a477ff60
2021-01-08 15:02:42 +08:00
Gavin Corkery
badf3962bc Add /metadata/watchdog
This directory will be used to store the mitigation count
from Package Watchdog in the case of a boot loop, in
order to persist the value across fs-checkpointing
rollbacks. One integer will be stored in a file in this
directory, which will be read and then deleted at the
next boot. No userdata is stored.

See go/rescue-party-reboot for more context.

Test: Manual test using debug.crash_sysui property
      and inspecting file
Bug: 171951174
Change-Id: I2bd5e1ebe14d7e9e4f0e0dbeb90cf76b8400752e
2021-01-07 19:41:07 +00:00
Hasini Gunasinghe
701fbca843 Integrate IKeystoreAuthorization aidl's addAuthToken with gatekeeperd.
Bug: 166672367
Test: VTS test

Change-Id: Ib847b68d4ab6fe4265c8b8aa5268db7c058b3629
2021-01-07 10:51:30 -08:00
Nicolas Geoffray
5266e041ef Merge "Add boot animation progress system property." 2021-01-07 09:23:35 +00:00
Shawn Willden
e3e5ae9eae Merge "Revert^2 "Revise KeymasterMessage versioning system"" 2021-01-06 22:58:32 +00:00
Shawn Willden
9323f4113b Revert^2 "Revise KeymasterMessage versioning system"
24d46bd512

Change-Id: I4edcfdada8321ff181db70002a2661b821f6b33f
Bug: 176867651
Merged-In: Idefcdd64afa7977f6dc2c4299e69cc5065dcc20d
2021-01-06 19:54:24 +00:00
Jaegeuk Kim
7ef01c913f Merge "Pass wiped and fs_type to vold to format encrypted partition" 2021-01-06 19:12:34 +00:00
Treehugger Robot
f24141175a Merge "Revert "Revise KeymasterMessage versioning system"" 2021-01-06 09:24:43 +00:00
Bonian Chen
24d46bd512 Revert "Revise KeymasterMessage versioning system"
Revert "Revise KeymasterMessage versioning system"

Revert "Revise KeymasterMessage versioning system"

Revert "Add new message versioning protocol"

Revert submission 1533821-new_km_versioning

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=adt3-userdebug&lkgb=7064747&lkbb=7064769&fkbb=7064769, bug 176867651
Reverted Changes:
I040fe7f62:Revise KeymasterMessage versioning system
Ibea104c39:Revise KeymasterMessage versioning system
Ibea104c39:Revise KeymasterMessage versioning system
I425fb45fc:Add new message versioning protocol

Change-Id: I1569334c59cb62be6aae4a42ce999f40c7a472de
BUG: 176867651
2021-01-06 06:42:21 +00:00
Treehugger Robot
208cad671d Merge "Adding Car GSI public key" 2021-01-06 01:05:43 +00:00
Treehugger Robot
bd11a5c73a Merge "Add assemble_cvd to com.android.virt" 2021-01-06 00:07:44 +00:00
Treehugger Robot
bde5350eed Merge "Revert "libprocessgroup: move freezer to uid/pid hierarchy"" 2021-01-05 23:33:12 +00:00
Treehugger Robot
936557b6f0 Merge "Revise KeymasterMessage versioning system" 2021-01-05 22:40:06 +00:00
Marco Ballesio
b01aa99408 Revert "libprocessgroup: move freezer to uid/pid hierarchy"
This reverts commit 1414a0d4d8.

Reason for revert: reversions of CLs from http://b/174776875 removed dependencies for this CL, and made the freezer non-functional. This CL has to be reverted as well

Bug:174776875
Change-Id: Idbd9532374bb661330b3c7546bbdf086a046aba3
2021-01-05 21:36:44 +00:00
Yifan Hong
8995b50b80 Merge "LRAP->DAP" 2021-01-05 19:29:25 +00:00
Treehugger Robot
d3ba0e28cd Merge "Reland "Create a pool of 20 measurement files per library for coverage."" 2021-01-05 19:16:50 +00:00
Jiyong Park
3ed3d4cd94 Add assemble_cvd to com.android.virt
assemble_cvd directly or indirectly depends on these modules. To add
assemble_cvd to the com.anroid.virt APEX, these modules are marked as
being available to the APEX.

Bug: 174639526
Test: m com.android.virt
Change-Id: Id3b2989a9f038a1cdc769a2021a116cf09ab1b15
2021-01-05 14:46:01 +09:00
Jiyong Park
0f2c5417c3 Merge "init: Sort the list of flattened APEX folders to avoid variations" 2020-12-31 03:51:03 +00:00
Adrian DC
9449583bc3 init: Sort the list of flattened APEX folders to avoid variations
* In 'ActivateFlattenedApexesFrom', the 'readdir' detects
   the APEX folders in a random way that depends on filesystems,
   built packages and order of the build chain

 * In normal cases, this is not an issue, however when building
   with Go configurations, we have a case where the package
   'com.android.tethering.inprocess' is built along the
   'com.android.tethering' overriden binary, and depending on
   the 'readdir' output, the mounts break the Tethering service

Change-Id: I8ac4a0284d8d885f732c71e846933869cf16a0bd
Signed-off-by: Adrian DC <radian.dc@gmail.com>
2020-12-30 22:41:33 +01:00
Treehugger Robot
da1264206c Merge "snapuserd: Enable in recovery." 2020-12-30 08:27:43 +00:00
Jaegeuk Kim
8e944335a4 Merge "fastboot: f2fs: handle return code correctly" 2020-12-30 02:54:32 +00:00
Daniel Rosenberg
ff5f4cc734 Merge "libsnapshot: Add decompression check to Inspect_Cow" 2020-12-30 00:04:04 +00:00
Jaegeuk Kim
58d10c209a fastboot: f2fs: handle return code correctly
The f2fs shares the fsck return code for sload.f2fs, since it calls fsck after
loading files.

enum {
	FSCK_SUCCESS                 = 0,
	FSCK_ERROR_CORRECTED         = 1 << 0,
	FSCK_SYSTEM_SHOULD_REBOOT    = 1 << 1,
	FSCK_ERRORS_LEFT_UNCORRECTED = 1 << 2,
	FSCK_OPERATIONAL_ERROR       = 1 << 3,
	FSCK_USAGE_OR_SYNTAX_ERROR   = 1 << 4,
	FSCK_USER_CANCELLED          = 1 << 5,
	FSCK_SHARED_LIB_ERROR        = 1 << 7,
};

Bug: 176471360
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I06289670834f29a59e704e772791f12328a073f8
2020-12-29 19:56:36 +00:00
Jaegeuk Kim
a7635718c4 Pass wiped and fs_type to vold to format encrypted partition
Bug: 172378121
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I358380fc47fe9d4d75337323c772ca1af122d2c6
2020-12-29 11:13:35 -08:00
Daniel Rosenberg
71a642689c libsnapshot: Add decompression check to Inspect_Cow
This adds the -d option to Inspect_Cow, which will cause it to attempt
to decompress all data blocks, reporting any errors it encounters.
Useful for detecting corruption in Cow files.

Bug: 172026020
Test: Inspect_Cow -d [cow_file]
Change-Id: Iebf5f7f485b33b36daab4ab07005ca37e51d692f
2020-12-28 18:20:19 -08:00
Daniel Rosenberg
53296d800b Merge "libsnapshot: Add cluster breaks after ops" 2020-12-29 02:14:57 +00:00
Treehugger Robot
8a573b4d9e Merge "init.rc: start tombstoned before switching mount namespace" 2020-12-28 23:11:53 +00:00
Remi NGUYEN VAN
f3f83ace67 Merge "Add apex_available to libnetutils" 2020-12-24 01:46:30 +00:00
Daniel Rosenberg
770099bde1 libsnapshot: Add cluster breaks after ops
Previously, we'd check if a new cluster was needed before we added a Cow
Operation. This would cause an op's associated data to go to the wrong
location, so instead we check if we'll need a new cluster after writing
each op.

Bug: 172026020
Test: cow_api_test (ClusterCompressGz)
Change-Id: Ia43afedcfd430961b34f5914da4265b89e6fadb9
2020-12-22 21:43:26 -08:00
Shawn Willden
db089205aa Revise KeymasterMessage versioning system
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: Ibea104c39942c6c88523688306a030f40e9b150f
2020-12-22 20:33:13 -07:00
Treehugger Robot
292fd5458d Merge "trusty: Add vendor variant of libtrusty_coverage" 2020-12-23 00:02:57 +00:00
Stephen Crane
c602562bb2 trusty: Add vendor variant of libtrusty_coverage
We want to add coverage statistics to the trusty-ut-ctrl tool, which is
a vendor binary. Thus we need a vendor variant of libtrusty_coverage.
Merges system libtrusty_test and vendor libtrusty into a single
vendor_available library so that we can add vendor_available to
libtrusty_coverage and make it accessible from vendor tools.

Bug: 175221942
Test: make libtrusty_coverage
Change-Id: I68cc8f1c1580bda8591dbe744e9751474811576d
2020-12-22 22:39:40 +00:00
Karthik Ramakrishnan
bb6cebb2ec Adding Car GSI public key
Bug: 140827657
Test: m qcar-gsi.avbpubkey
Change-Id: Ib493d17b9ca3859b8613de12fb8015d2ffb766f6
2020-12-21 17:07:59 -08:00
Bernie Innocenti
bc053268cf Merge "Add explicit Result::ok() checks where needed" 2020-12-21 18:31:58 +00:00
Bernie Innocenti
062ef5356d Add explicit Result::ok() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests
Exempt-From-Owner-Approval: mechanical mass refactoring
Change-Id: I8d40b1e3cb5d2f76baf77b8a190df4366909f7b6
2020-12-20 17:06:17 +00:00
Bernie Innocenti
989efb67e3 Merge "Add explicit Result::has_value() checks where needed" 2020-12-20 07:36:38 +00:00
Bernie Innocenti
62ba2b11b1 Add explicit Result::has_value() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests
Change-Id: Ifd5dcda48e370d750e243d427e68a77dce333951
2020-12-19 21:17:16 +09:00
Yifan Hong
bd9ab50667 LRAP->DAP
Test: none
Change-Id: I96d597c3444f8f30e091fa1f049766de0a0cffb0
2020-12-17 10:56:09 -08:00