Commit graph

328 commits

Author SHA1 Message Date
David Anekstein
d12c75f531 trusty/test/binder: Add package support for modules that have AIDL interfaces
Bug: 240461931
Change-Id: Ia88303a4b806be860cac5a324d55d0ab87dce189
2022-12-02 20:27:28 +00:00
Treehugger Robot
4304cbd8db Merge "trusty-binder: Add AIDL files for trusty-binder tests" 2022-07-26 15:19:56 +00:00
David Anekstein
c6768f7aad trusty-binder: Add AIDL files for trusty-binder tests
Bug: 224644083
Change-Id: I4818bfee421996dbf313c96d3ab53d9d0429f0c4
2022-07-21 15:34:43 -04:00
Tri Vo
846da873b4 storageproxyd: Remove setuid, setgid, and capset
These operations require excessive SELinux and UNIX permissions.

Instead of dropping privileges after starting we will start
storageproxyd as "system" user.

Bug: 205904330
Test: com.android.storage-unittest.td
Change-Id: I0b2503a746c52474c8cc2e1f7a2fbe17c98d6d8b
2022-07-15 10:34:05 -07:00
Treehugger Robot
7e25d3e8fa Merge "Implement GetRootOfTrust" 2022-06-07 22:43:20 +00:00
Shawn Willden
396bc3f964 Implement GetRootOfTrust
Bug: 219076736
Test: VtsAidlKeyMintTargetTest
Change-Id: I8485360f253ca20f008c5df5090e79c1781fbb4f
2022-06-07 13:19:23 -06:00
Daniel Angell
6c2d812508 Increase num_retries to reduce likelihood of test flake
Flakiness was observed in this build:
https://android-build.googleplex.com/builds/pending/P35853772/qemu_generic_arm32_gicv3_test_debug/latest/view/logs/build_error.log

But most other builds do not have this issue.

Bug: 234788755
Change-Id: I4cf7d05a56eb678164bf0006bfb190442d6d4e03
2022-06-06 21:25:17 +00:00
David Drysdale
ad226c11a9 Merge "Make crate vendor_available" 2022-06-06 06:49:13 +00:00
Stephen Crane
08d8557718 [trusty] Bump number of ACVP arguments to match boringssl
Boringssl added a new argument to the ACVP modulewrapper, so we need to
sync this change to the Trusty modulewrapper.

Test: m trusty_acvp_modulewrapper
Bug: 233873228
Change-Id: Ia79705d9fe32a07afc09cf8e0231db300073b504
2022-05-25 12:18:47 -07:00
David Drysdale
9ee82396c4 Make crate vendor_available
Bug: 195310053
Test: build, TreeHugger
Change-Id: I466a7cf609a3c945a56d3f3fac99cbc04cb4dc9b
2022-05-25 13:58:11 +01:00
David Drysdale
37a8ac1d45 KeyMint HAL: pass auth token on updateAad
Bug: 230716629
Test: CtsVerifier with aosp/2077898 included
Change-Id: I2ba275718ef7ce6cc701ac2eb4a122639d7a4351
2022-05-18 11:12:01 +01:00
Florian Mayer
78bf3beb49 Promote tests to HWASan presubmit.
Change-Id: I55711f80c4ea870a78e7971fe133f096dac9ef1a
2022-05-03 19:40:36 +00:00
Anis Assi
5f43e61fef Adding trong@google.com as fuzzer owner for trusty fuzzers
Bug: 221891733
Change-Id: I41895ffbd6d65f9f3de90088c5f0b9ba2f3210d4
2022-04-18 20:42:10 +00:00
Thurston Dang
b37b47df01 Merge "[trusty][apploader] Handle APPLOADER_ERR_POLICY_VIOLATION" 2022-04-12 19:21:05 +00:00
David LeGare
dc2d792adc [libtrusty-rs] Add recv variant that uses Vec<u8>
* Add new `recv` method that takes a `Vec<u8>` and automatically
  allocates extra buffer space and retries the read call if the buffer
  does not have enough capacity.
* Rename the existing `recv` method to `recv_no_alloc`, and update docs
  to clarify the behaviors of both methods.
* Add tests for the new `recv` method and update existing tests to use
  `recv_no_alloc` instead.

Test: tipc-test-rs -m 1024 -t echo
Bug: 226659377
Change-Id: Ic437b617751e865da119fe0c4ef8aa456a63bf3c
2022-04-06 22:40:05 +00:00
David LeGare
23dedb660e Setup tests for libtrusty-rs
Test logic is based on the tests in the original tipc-test C binary,
but adapted to use the Rust unit test infrastructure to make running
tests easier.

Test: Ran the tests
Bug: 226659377
Change-Id: I998013b2f8b304299acb09d58beb49330747802a
2022-04-06 21:11:04 +00:00
Thurston Dang
45dbdd1ef0 [trusty][apploader] Handle APPLOADER_ERR_POLICY_VIOLATION
Add a specific error message to the Android CLI tool for the
case where the policy engine (http://go/aog/2051516) disallows
loading.

Test: Load a signed app that violates the policy
Bug: 208968719
Change-Id: I2aaa218ab3a7297ea62448de49baa0bfd6b1ee52
2022-04-05 20:25:57 +00:00
David LeGare
fd343ee2ea Add libtrusty-rs
Test: manual using tipc-test-rs
Bug: 226659377
Change-Id: I4afc24e5a602e7ca85d5c7088fecc211b71bfc66
2022-04-04 19:12:15 +00:00
Florian Mayer
14deb086bf Add keymint to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: Ica324e3eb495bc3c95ae9f892c744a3204d2d072
2022-03-18 23:01:32 +00:00
Tri Vo
5ba7cba78f Merge "trusty: set_attestation_key: Provision device IDs" 2022-03-18 18:14:18 +00:00
Tri Vo
7aeb43ecfc trusty: set_attestation_key: Provision device IDs
Bug: 221128605
Test: /vendor/bin/trusty_keymaster_set_attestation_key /vendor/etc/keymaster_soft_attestation_keys.xml
Change-Id: Iabe2162a7d50f16c966f16ca2eda5a7651779848
2022-03-17 17:49:35 -07:00
Tri Vo
83b58f93a2 trusty: Update TIPC UAPI header
TRUSTY_SEND_SECURE operation was added to Trusty Linux driver by
aosp/1930989.

Bug: 224563842
Test: m libtrusty
Change-Id: Ic922ec177a8d35dba351415ab429216a1931a64d
2022-03-14 16:30:12 -07:00
David Drysdale
b99ace4af1 Merge "Include correct authorization_set.h header" 2022-03-01 10:31:26 +00:00
Treehugger Robot
8e4b2bfd5b Merge "Update to KeyMint & iRPC v2" 2022-02-28 21:46:00 +00:00
Shawn Willden
0485712141 Update to KeyMint & iRPC v2
Bug: 221390931
Test: run vts -m vts_treble_vintf_vendor_test
Change-Id: I1749439700f78433d31b52067edb32a031cc8777
2022-02-28 09:35:43 -07:00
Tri Vo
96686aaf60 Merge "Bumping the HAL client version." 2022-02-25 18:03:20 +00:00
Treehugger Robot
df62d41eeb Merge "Provide alternate SE RoT provisioning path." 2022-02-23 18:13:01 +00:00
Tri Vo
7da30bd9f8 Merge "trusty: Convert Trusty driver tests to python_test" 2022-02-23 17:58:06 +00:00
Shawn Willden
0f89bc1270 Provide alternate SE RoT provisioning path.
On some devices it is infeasible to provision the KeyMint RoT bits in
the Android Bootloader.  This provides an alternate path to provision
them from the TEE during early boot.

Bug: 219076736
Test: VtsAidlKeyMintTargetTest
Change-Id: Ibae9050b9a102dad3710f9495d3dfa43fa1d1b3f
Merged-In: Ibae9050b9a102dad3710f9495d3dfa43fa1d1b3f
2022-02-22 23:51:15 -07:00
David Drysdale
74f763961a Include correct authorization_set.h header
Bug: 206470603
Test: TreeHugger
Change-Id: I748660d45a539c9e2c2e13605d1d4f61b1b2fb5e
2022-02-23 06:27:16 +00:00
Tri Vo
ccc11f4969 trusty: Convert Trusty driver tests to python_test
Original tests are implemented as shell scripts here:
https://android.googlesource.com/trusty/vendor/google/aosp/+/refs/heads/master/scripts/test-map#100

Bug: 219992178
Test: trusty_driver_test
Change-Id: I8a55cb660bb0cb27bb4ef32aaa0658d0c17c36e3
2022-02-22 17:40:29 -08:00
Max Bires
b6179f25be Bumping the HAL client version.
This CL bumps the reported version for Trusty's
IRemotelyProvisionedComponent HAL interface for KeyMint. It also adds
the uniqueId field added to the RpcHardwareInfo in version 2.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I336ec7cd12ca2ea3b836601ebe0ca400524b8ca4
2022-02-15 02:24:04 +00:00
Stephen Crane
d160497c59 storageproxyd: Sync parent dir when creating a file
Switches to syncing the parent directory immediately when creating a new
file rather than lazily waiting for a sync request. Because we only
create a new file when the userdata partition is cleared, this operation
doesn't need to be fast in the normal case. This avoids needing to track
the parent directory for each file for lazy syncing later, since storage
backing files may be in a subdirectory of the root.

Test: m storageproxyd, boot using new service binary
Bug: None
Change-Id: Ibcafae7da493864515c099bd81d48c95b0e5d8c3
2022-01-21 14:42:01 -08:00
Stephen Crane
6f890b474b storageproxyd: Use alternate data path if in DSU state
Adds a check for a DSU mode boot in storageproxyd. Changes path handling
so that storageproxyd will not allow opening a file in the root data
path in DSU mode. Instead, storageproxyd creates an "alternate/"
directory in the data directory and the TA must use this directory to
store its backing file.

Re-landing reverted change: Iad68872dc6915f64eaf26cd3c92c04d9071ef169

Test: Boot into DSU and inspect logs for "Cannot open root data file"
Test: Test that TD writes in DSU mode don't corrupt host image storage
when using a compatible storage TA that supports alternate data mode.
Bug: 203719297

Change-Id: I1d07e7c3d15dc1beba2d340181d1b11a7988f869
2022-01-21 14:41:17 -08:00
David Li
0a4e111bc6 Merge "Revert "storageproxyd: Use alternate data path if in DSU state"" 2022-01-21 07:59:42 +00:00
Stephen Crane
97b8c1d697 Revert "storageproxyd: Use alternate data path if in DSU state"
This reverts commit 7c5658b5fd.

Reason for revert: selinux test errors in some branches

Bug: 215630608
Change-Id: I2a9c9d914b6c1d1248b4f11bd69484ae6b0ba8d1
2022-01-21 06:54:43 +00:00
Treehugger Robot
3ecaae4fdf Merge "storageproxyd: Use alternate data path if in DSU state" 2022-01-20 19:10:40 +00:00
David Drysdale
37514bb907 Report Trusty KeyMint as KmVersion::KEYMINT_2
Bug: 194358913
Test: TreeHugger, VtsAidlKeyMintTargetTest
Change-Id: Ic5e321c739a66a384907539a339511e5418e9c6a
2021-12-15 12:02:06 +00:00
Stephen Crane
7c5658b5fd storageproxyd: Use alternate data path if in DSU state
Adds a check for a DSU mode boot in storageproxyd. Changes path handling
so that storageproxyd will not allow opening a file in the root data
path in DSU mode. Instead, storageproxyd creates an "alternate/"
directory in the data directory and the TA must use this directory to
store its backing file.

Test: Boot into DSU and inspect logs for "Cannot open root data file"
Test: Test that TD writes in DSU mode don't corrupt host image storage
when using a compatible storage TA that supports alternate data mode.

Bug: 203719297
Change-Id: Iad68872dc6915f64eaf26cd3c92c04d9071ef169
2021-12-14 15:24:40 -08:00
David Drysdale
c5b7d179c2 Depend on KeyMint HAL via default
This allows for easier bumping of the KeyMint version level.

At the moment this change should have no effect: the same dependency
is used, just reached via a default rather than explicitly.

However, when the KeyMint version increases in the near future, using
this default should mean that no change is needed here: the default
definition will change to -V2 and this will be referenced here.

Test: TreeHugger
Change-Id: Ic250e5b91ee2b48cd7a05783ce21af16ae330ed1
2021-12-02 08:16:25 +00:00
Armelle Laine
904cae37ce Merge "trusty: update default_applicable_licenses "Android-Apache-2.0"" 2021-11-30 23:41:46 +00:00
Armelle Laine
c2cc120d60 trusty: update default_applicable_licenses "Android-Apache-2.0"
rpmb_dev is a rpmb device stub used in emulation
as well as platform early bringup so we don't expect
any open source developer to be impacted by the migration
from MIT to Apache 2.0.
Note that with such a migration to Apache 2.0, recipients
won't receive lesser permissions, they just have updated
requirements for which license text to share along with the code.

Bug: 191508826
Test: None
Signed-off-by: Armelle Laine <armellel@google.com>
Change-Id: I0ae2bc66901344f8f9227e929a98946e52c50355
2021-11-29 19:53:54 +00:00
Treehugger Robot
1d02ce9ad4 Merge "Configure Trusty KeyMint devices to use attest_keys." 2021-11-22 18:21:09 +00:00
Shawn Willden
b440e0c077 Configure Trusty KeyMint devices to use attest_keys.
Change-Id: If86133e7648b601a4a61ea5614e6971a2bb8d264
Bug: 197096139
Test: Manual
2021-11-22 16:52:30 +00:00
David Drysdale
fcf3fc08e4 KeyMint: don't mix Binder and std shared pointers
Bug: 203871378
Test: VtsAidlKeyMintTargetTest, TreeHugger
Change-Id: I8671342939af2bbdef643be9ce81b0bb9e7ae1a9
2021-10-28 15:39:34 +01:00
Marco Nelissen
3e923cd527 Fix 32-bit build
Bug: None
Test: build
Change-Id: Id1a9c2bd4526750eca9b85896d0e90eed58b8f51
2021-10-20 10:11:52 -07:00
Marco Nelissen
08fec49a3b Log if keymaster IPC takes too long
Bug: None
Test: run with very low timeout and verify it logs
Change-Id: I2818683f65c2191518373609c6171c056de55a9a
2021-10-20 07:51:05 -07:00
Thurston Dang
7e8dab775b storageproxyd: discard writes when checkpointing, if necessary
If a checkpointing operation is in progress, discard any write operations
that are flagged as STORAGE_MSG_FLAG_PRE_COMMIT_CHECKPOINT. In tandem
with trusty-side changes that set the flag appropriately, this avoids
the awkward case where the checkpoint is rolled back, which potentially
leads to inconsistency between the data and the superblock.

Based on Stephen's CL/1845477 "Add helper to check checkpoint state of
mounts".

Test: m storageproxyd
Bug: 194313068
Change-Id: Ib6a432db1bc1b034f803b743b0d7322e3f31d814
2021-10-12 03:47:24 +00:00
Armelle Laine
a3359bb3c9 Merge "storageproxyd: Retry RPMB request on UNIT ATTENTION" 2021-10-04 17:32:51 +00:00
Max Bires
9eb326c9c0 Merge "Make RemoteProvisioner required for KeyMint cc_bin" 2021-09-29 19:26:40 +00:00