Commit graph

67374 commits

Author SHA1 Message Date
Hasini Gunasinghe
6fd560377f Integrate IKeystoreAuthorization aidl's addAuthToken with gatekeeperd.
Bug: 166672367
Bug: 177830239
Bug: 177791435
Bug: 177787061
Bug: 177787180
Test: VTS test
Change-Id: I15b751ec993a240756e58c2df3352c544bced517
2021-01-19 14:42:33 +00:00
Louis Chang
bccf7601ae Merge "Revert "Integrate IKeystoreAuthorization aidl's addAuthToken wit..."" 2021-01-18 14:58:14 +00:00
Louis Chang
4c66b8a35c Revert "Integrate IKeystoreAuthorization aidl's addAuthToken wit..."
Revert "Implement addAuthToken method of IKeystoreAuthorization ..."

Revert "Integrate IKeystoreAuthorization aidl's addAuthToken wit..."

Revert submission 1519257-rename_auth_service

Reason for revert: breaking WM presubmit, b/177787180
Reverted Changes:
Ib847b68d4:Integrate IKeystoreAuthorization aidl's addAuthTok...
I7893ab452:Integrate IKeystoreAuthorization aidl's addAuthTok...
I4a092119c:Implement addAuthToken method of IKeystoreAuthoriz...

Change-Id: Icc48050a127fa3a931cb0b591db8165384e2fe25
2021-01-18 10:01:12 +00:00
Treehugger Robot
9d78718441 Merge changes I5d17fc87,If1cc6b9a
* changes:
  Cgroup APIs are guarded
  Remove __ANDROID_API__ guards
2021-01-18 09:21:00 +00:00
Treehugger Robot
ba73e995e5 Merge "Integrate IKeystoreAuthorization aidl's addAuthToken with gatekeeperd." 2021-01-16 22:05:18 +00:00
Kelvin Zhang
8196853980 Merge "Fix macOS build." 2021-01-16 15:05:43 +00:00
Elliott Hughes
4444824902 Fix macOS build.
Bug: http://b/177702122
Test: treehugger
Change-Id: I64ad7f506fb241c5f949c7bbac55a26161bd510e
2021-01-15 17:46:28 -08:00
Tri Vo
e865d88531 Merge changes I06a7b475,Ic7a30b75,Ib22cf72b
* changes:
  trusty: Collect sancov file from confirmationui fuzzer
  trusty: coverage: Append .<pid>.sancov to sancov file names
  trusty: fuzz: Explicit errors instead of asserts
2021-01-16 01:13:35 +00:00
Treehugger Robot
5809095dab Merge "Move debuggerd_test over to mallopt()." 2021-01-16 01:07:05 +00:00
Treehugger Robot
6e6df01f3e Merge "Move cutils over to mallopt()." 2021-01-16 01:04:24 +00:00
Elliott Hughes
03b283a65f Move debuggerd_test over to mallopt().
Bug: http://b/135772972
Test: treehugger
Change-Id: I178f2a753b5608d9e72cee8874524ad4faf701d7
2021-01-15 11:34:26 -08:00
Andrew Scull
ecd550a8d7 Merge "fastboot: Add pvmfw" 2021-01-15 19:19:36 +00:00
Elliott Hughes
66304a0ada Move cutils over to mallopt().
Bug: http://b/135772972
Test: treehugger
Change-Id: I35e0fc657f2e4cecea2a29f78cad148895413e17
2021-01-15 11:18:24 -08:00
Andrew Scull
be823d71bd fastboot: Add pvmfw
The pvmfw partition holds the protected VM firmware that is used by
Protected KVM to bootstrap the trust in protected VMs. Teach fastboot
about the partition so it gets flashed with flashall.

pvmfw is an AVB chained partition so is marked as BootCritical to allow
ABL's AVB verification to pass.

Test: tab complete and flashall
Bug: 171280178
Change-Id: Ie4cc478de25a945bc510488d87c2bee3aa5031f2
2021-01-15 15:50:01 +00:00
Tri Vo
8da3ee71a3 trusty: Collect sancov file from confirmationui fuzzer
Bug: 174402999
Test: trusty_confirmationui_fuzzer
Change-Id: I06a7b475c0023cf1530aff636e5ac2295009fd73
2021-01-14 21:25:10 -08:00
Tri Vo
315967e660 trusty: coverage: Append .<pid>.sancov to sancov file names
Bug: 175221942
Test: adb shell ./trusty_gatekeeper_fuzzer -runs=0 corpus
Change-Id: Ic7a30b7531e8a327fb8ebe953fa02946e8539579
2021-01-14 21:25:10 -08:00
Tri Vo
2c56d833c5 trusty: fuzz: Explicit errors instead of asserts
Bug: 171750250
Test: m \
      trusty_test_fuzzer \
      trusty_gatekeeper_fuzzer \
      trusty_keymaster_fuzzer \
      trusty_confirmationui_fuzzer
Change-Id: Ib22cf72b2db7b991e716c0116ca57d3f77459ada
2021-01-14 21:25:07 -08:00
Treehugger Robot
76d44b077e Merge "Remove healthd." 2021-01-14 23:41:46 +00:00
Tri Vo
3c651c278c Merge changes Iad1713e1,Iaee2c74b,I6bd1c8b2,I067dd077
* changes:
  trusty: Add simple fuzzer for keymaster TA
  trusty: Increase limit on coverage counters
  trusty: Write out sancov file when fuzzer exits
  trusty: Switch to dmabuf for coverage shared memory
2021-01-14 21:28:16 +00:00
Treehugger Robot
8e3826b8b1 Merge "Make ro.product.cpu.abilist* to be fetched dynamically" 2021-01-14 18:34:21 +00:00
Daniel Rosenberg
bdd1244d54 Merge "libsnapshot: Set default cluster size to 200" 2021-01-14 01:12:25 +00:00
Stephen Crane
f7b8a597f1 trusty: Add simple fuzzer for keymaster TA
Adds a simple libfuzzer-based coverage guided fuzzer for keymaster.
Current coverage is low, so we'll need to improve this with an initial
corpus or a more sophisticated protocol aware fuzzer.

Bug: 175918322
Test: make trusty_keymaster_fuzzer
Test: adb shell /data/fuzz/arm64/trusty_keymaster_fuzzer/trusty_keymaster_fuzzer
Change-Id: Iad1713e1a73cc5a6a3ec742cc433d1337aca9bc3
2021-01-13 16:21:49 -08:00
Stephen Crane
6735f8475e trusty: Increase limit on coverage counters
Keymaster has more than 4096 counters, so we need to allocate a larger
section for the libfuzzer extra counters. Increases the size of the
extra counters section to 16384.

Bug: 171750250
Test: atest libtrusty_coverage_test
Change-Id: Iaee2c74b6d0c7ae8a2e5a30525759f89f825a091
2021-01-13 16:09:33 -08:00
Stephen Crane
6bd77df8fc trusty: Write out sancov file when fuzzer exits
Add emission of sancov file when CoverageRecord is destroyed. This
will occur when a fuzzer driver exits cleanly, i.e. -runs=0 with an
existing corpus.

Test: make trusty_gatekeeper_fuzzer
Test: adb shell ./trusty_gatekeeper_fuzzer -runs=0 corpus
Bug: 175221942
Change-Id: I6bd1c8b2f2091e894c35f7a4874b54577a91c8fc
2021-01-13 16:09:31 -08:00
Stephen Crane
0d67131dd9 trusty: Switch to dmabuf for coverage shared memory
Trusty shared memory now uses dmabuf instead of memfd. Switch the
coverage buffer allocation to use libdmabufheap.

Test: atest libtrusty_coverage_test
Bug: None
Change-Id: I067dd0774d19b42380ce5cb8ceb3541fa77ef9f0
2021-01-13 15:56:25 -08:00
Wenhao Wang
1ee38ede4c Merge "trusty: Adapt to Confirmationui Corpus Format" 2021-01-13 20:17:31 +00:00
David Anderson
c6b6c08f95 Merge "libsnapshot: Fix a race condition in WaitForDelete." 2021-01-13 17:22:28 +00:00
Hridya Valsaraju
0db7ccaf99 Merge "Setup ueventd to support DMA-BUF system-secure heap" 2021-01-13 16:23:52 +00:00
David Anderson
cadab3b844 libsnapshot: Fix a race condition in WaitForDelete.
WaitForDelete is supposed to block until close() has been called on the
COW image. However, it could race with the destructor for Snapuserd
since nothing guaranteed it was freed within the global lock.

This patch fixes the bug and refactors the surrounding code to make the
responsibilities of each thread clearer.

Bug: N/A
Test: vts_libsnapshot_test
Change-Id: Icfc264e6dff378db585c81cde381cc24269f4800
2021-01-12 23:21:57 -08:00
Treehugger Robot
8376d87e2d Merge "Let init mount/unmount debugfs for non-user builds" 2021-01-13 04:24:22 +00:00
Daniel Rosenberg
db03c5a18e libsnapshot: Set default cluster size to 200
Grouping metadata into clusters decreases the overhead occured by extra
reads. Assuming a constant added cost with reads, we currently measure
this to be around 1.2 microseconds. For an entire OTA, this can add up
to several seconds of time. Setting the cluster size to 200 removes
99.5% of that extra time, while adding 20 bytes per 200 ops, as well as
up to 200*20 byes (4kb) unused space near the end of the file, although
it would be half of that on average. We save 99.5% of the overhead of
separate reads for a 0.5% space increase.

We've opted for a change to the default so that tools that estimate cow
size and any others will automatically be kept up to date, without
needing to update the value everywhere.

Bug: 172026020
Test: cow_api_test
Change-Id: Id4525cf2abfecf4691b46588823cb3cb4f6234d9
2021-01-12 20:06:20 -08:00
SzuWei Lin
bedae3910c Merge "Deprecate /factory" 2021-01-13 01:11:43 +00:00
Hridya Valsaraju
fb921a1c4e Let init mount/unmount debugfs for non-user builds
This change will help non-user builds with keeping debugfs
disabled during run time. Instead, debugfs will be mounted by init
to enable boot time initializations to set up vendor debug data
collection and unmounted after boot. It will be also be mounted by
dumpstate for bug report generation and unmounted after.

This change is only intended to help vendors (who depend on debugfs to
collect debug information from userdebug/eng builds) keep debugfs
disabled during runtime. Platform code must not depend on debugfs at all.

Test: manual
Bug: 176936478
Change-Id: I2e89d5b9540e3de094976563682d4b8c5c125876
2021-01-12 14:41:53 -08:00
Wenhao Wang
dc45de0553 trusty: Adapt to Confirmationui Corpus Format
The corpus of Confirmationui usually contains multiple data packets
to be transfered from Android side to Trusty side.
Therefore we adjust the Confirmationui fuzzer so that it can send
data to Confirmationui TA several times through a same tipc channel.

Bug: 174402999
Bug: 171750250
Test: /data/fuzz/arm64/trusty_confirmationui_fuzzer/trusty_confirmationui_fuzzer
Change-Id: Ib6ae831e6a19c98eb62a1c75f77eb00f914e2f5c
2021-01-12 12:54:27 -08:00
Hridya Valsaraju
f7c0f3d830 Setup ueventd to support DMA-BUF system-secure heap
Memory allocated from this heap will be used for secure playback.

Test: manual
Bug: 175697666
Change-Id: I16275ef0cef39b7b56cdce7c3545622712d438dc
2021-01-12 12:49:24 -08:00
David Anderson
270c98f190 Merge changes from topic "snapuserd-selinux"
* changes:
  libsnapshot: Fix tests that depend on PrepareOneSnapshot().
  libsnapshot: Ensure dm-user devices are destroyed after a merge.
  libsnapshot: Fix tests for mapping snapshots in first-stage init.
  init: Add an selinux transition for snapuserd.
2021-01-12 19:01:01 +00:00
Jiyong Park
ab8a7d2a03 Cgroup APIs are guarded
The following API was added for the API level 30 and beyond. Currently,
its existence is tested using the null check which is done regardless of
the min sdk version of the compilation unit. (which in turn required us
to mark the API symbol weak regardless of the min sdk version.)

* AGroupController_getFlags

Now, we have a better way of testing the API availability;
__builtin_available. The null check is replaced with the call to the
compiler-provided macro which determines if the code is running in a
version of OS where the API is known to exist.

Bug: 150860940
Bug: 134795810
Test: m

Change-Id: I5d17fc877c553c402a62485b61af574a54658a76
2021-01-12 20:50:27 +09:00
Jiyong Park
2d30fe48d4 Remove __ANDROID_API__ guards
__ANDROID_API__ guards are removed in favor of __INTRODUCED_IN macros.

Currently, __INTRODUCED_IN macro does nothing for these headers (it's
meaningful only to the headers processed by versioner which are limited
to binic headers). The plan is to make the macros to tag the declaration
with the availability attribute. Then, when the min_sdk_version of a
caller is set to an API level that is older than the API level of the
APIs, the compiler will provide them as weak symbols and enforce that
calling the APIs are guarded with a runtime check.

For now, these guards are preventing from making a build system change
to let __ANDROID_API__ track the min_sdk_version property instead of the
sdk_version property. With the build system change, __ANDROID_API__ will
suddenly drop for the native modules where min_sdk_version <
sdk_version, which is the case when the modules are included in APEXes.
As a result, some new APIs will be unavailable at build-time. Dropping
the hand-written guards fixes the problem.

Bug: 163288375
Test: m
Change-Id: If1cc6b9af410f536abe6d777c22711209fa76530
2021-01-12 20:50:27 +09:00
David Anderson
8302b875a0 libsnapshot: Fix tests that depend on PrepareOneSnapshot().
PrepareOneSnapshot was hardcoded in a way that only worked with
pre-compression devices. This patch makes it use the public API and
supported update flow.

One test, SnapshotTest.Merge, now uses OpenSnapshotWriter instead of
MapUpdateSnapshot. There are still other tests using the old API call.

Bug: N/A
Test: vts_libsnapshot_test
Change-Id: Iec4bf6efe6a82e1f90b81fa4211201845ebabe62
2021-01-11 23:37:32 -08:00
Akilesh Kailash
06ee6f1753 Merge "libsnapshot:snapuserd: Handle un-aligned IO request" 2021-01-12 06:51:47 +00:00
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