Commit graph

495 commits

Author SHA1 Message Date
Treehugger Robot
43772f2bc2 Merge "Update trusty to use secretkeeper hal V1" into main 2024-12-04 21:22:00 +00:00
Treehugger Robot
63051ccde0 Merge "trusty: utils: rpmb_dev: secure storage support for test VM" into main 2024-12-04 03:18:05 +00:00
Matt Gilbride
7a1cf9a52d Update trusty to use secretkeeper hal V1
The HAL has been updated to V2, but the trusty prebuilt implementation
does not yet have that code. Update trusty secretkeeper build to use V1
specifically instead of latest until the prebuilt has those changes.

Bug: 372223451
Test: TH
Change-Id: Ic2e9b578b50685d71b5597d8d34ac7ee36b6ddc9
2024-12-03 23:33:43 +00:00
David Drysdale
bc6efddf79 Merge "Move Trusty C++ KeyMint to v4" into main 2024-11-27 07:18:20 +00:00
David Drysdale
487584da23 Move Trusty C++ KeyMint to v4
- Declare v4 HAL.
- Declare version 400 in Package Manager (when unfrozen).
- Link to current (V4 when unfrozen) versions of support libraries.
- Add `setAdditionalAttestationInfo()` method to HAL service.
- Add `SetAdditionalAttestationInfo()` method to implementation, using
  the common message types.
- Add Trusty-specific message code for the
  `SET_ADDITIONAL_ATTESTATION_INFO` message exchange.

Test: VtsAidlKeyMintTargetTest (new test fails until TA updated too)
Bug: 369375199
Change-Id: I4699aea3ab8a0723a5c2bc1493f7bbb69cdfd6df
2024-11-25 15:52:31 +00:00
Treehugger Robot
e3db20857f Merge "Remove |ro.hardware.| prefix in KM VM sys property" into main 2024-11-23 00:14:01 +00:00
Armelle Laine
150483e3a1 trusty: utils: rpmb_dev: secure storage support for test VM
Bug: 367423387
Test: start storageprxyd_test_system
Change-Id: Ia9c07d9872a2975c4bd621c16a5df437e8a0736b
2024-11-21 03:11:51 +00:00
Alice Wang
d5c8b0bddf Remove |ro.hardware.| prefix in KM VM sys property
As per comment in aosp/3342288

Bug: 368502791
Test: launch_cvd --secure_hals=guest_keymint_trusty_insecure
Test: atest VtsAidlSharedSecretTargetTest
Change-Id: I71b6266fbd480c0ebe2a7946adadd88f38afb3e7
2024-11-20 08:32:40 +00:00
David Drysdale
91b97d7362 Merge "Declare support for v4 of KeyMint HAL" into main 2024-11-20 06:27:24 +00:00
Orlando Arbildo
e4414f5856 Merge "trusty: utils: rpmb_dev: add wv secure storage init.rc" into main 2024-11-15 22:26:21 +00:00
David Drysdale
03a14f5284 Declare support for v4 of KeyMint HAL
Bug: 377744414
Bug: 369375199
Test: vts_treble_vintf_vendor_test
Change-Id: I1fc04834819cc9291d89a6ee6803cbc5d5d91437
2024-11-14 18:18:55 +00:00
Alice Wang
16693fae25 Rename system property to enable KeyMint VM
This allows us to regroup Widevine VM under the same trusty
group.

Bug: 368502791
Test: launch_cvd --secure_hals=guest_keymint_trusty_insecure
Test: atest VtsAidlSharedSecretTargetTest
Change-Id: Ica76a896e99f70a64af229bda68622a2ce0dea1f
2024-11-14 14:37:19 +00:00
Armelle Laine
5f216ffdc3 trusty: utils: rpmb_dev: add wv secure storage init.rc
Bug: 371777025
Change-Id: Id4f26509568dac1045e0b2ba58a045874555a303
Test: cuttlefish with trusty-vm enablement apex, run WV VTS
2024-11-12 18:54:31 +00:00
David Drysdale
5969d69248 Declare previous version when using frozen HALs
The KeyMint HAL has been updated to v4, but frozen builds (e.g. 25Q1)
remain on the previous version.  The core AIDL version is handled
automatically, but we also have a package manager flag whose value
is (100 * HAL-version).  Use `RELEASE_AIDL_USE_UNFROZEN` to switch
between `required` configs for that.

Test: TreeHugger
Bug: 377808462
Bug: 378026324
Change-Id: Id042bee2a81e8563e1029ea7bb43452715e3edee
2024-11-11 19:17:20 +00:00
Karuna Wadhera
e8ff8b494a Set the proper FEATURE_HARDWARE_KEYSTORE version
The binary implements V3 of the KeyMint HAL, so the feature version
should match.

Bug: 369375199
Bug: 378384123
Test: treehugger
Change-Id: Ib26ac73cf6593d9a50f7a019129c6e5e237ae2cd
2024-11-11 18:06:30 +00:00
Alice Wang
5d5c732a3b Rename KM VM related system properties
To organize it under trusty and distinguish it from
Widevine VM.

Bug: 368502791
Test: launch_cvd --secure_hals=guest_keymint_trusty_insecure
Test: atest VtsAidlSharedSecretTargetTest
Change-Id: I48e43b9709e59b1cb9e1ba9113d5ef894469f485
2024-10-30 09:44:27 +00:00
Karuna Wadhera
03f7133b0e Pin KeyMint dependency to correct/specific version
libkeymint depends on the latest version of the HAL, which will soon be
bumped to v4. Since this implementation won't immediately be upgraded,
and this dependency seems unused, remove it.

Bug: 369375199
Test: Treehugger
Change-Id: I5e952595bb4d4d8a283b286b5054576394788f16
2024-10-23 23:13:13 +00:00
Per Larsen
699faa849b trusty: tipc-test: Fix D argument
The D flag requires an argument so it should be followed by a colon
in sopts. Adding the missing colon is necessary to prevent a segfault.

Test: path/to/tipc-test -D VSOCK:200:1
Bug None

Change-Id: I78119b7e42aba5d30b62d88ff5d94c01dbc2eb64
2024-10-09 11:23:32 +00:00
Arve Hjønnevåg
f29f1a2a38 trusty-ut-ctrl: Allow stream mode
When using vsock in stream mode (or any other stream mode connection)
message boundaries are not preserved, so the original messages can get
both split and merged. The TEST_MESSAGE and TEST_TEXT messages don't
have a length field which makes it imposible to support every possible
message that can be sent over a channel that preserves message
boundaries. Since the current message header types don't contain any
printable character, we assume any of these characters in a message
payload means that two messages got merged, so we split them back up.
Additionally, if we receive a message that does not start with a valid
message header, we assume it is a continuation of the previous message.

Test: trusty-ut-ctrl -D VSOCK:2:1 com.android.libctest ^Z fg
Bug: 298705967
Change-Id: I0e470a23664268f86e4defd824c47be3479c8f25
2024-10-03 04:33:38 +00:00
Armelle Laine
3d90ed0cea trusty: utils: trusty-ut-ctrl: fix the vendor target
Bug: 369492636
Test: trusty-ut-ctl -D <trusty device> <port-name>

Change-Id: I9d8a298941caa4e3c5a424269577580be0ba79c8
2024-09-25 07:00:51 +00:00
Armelle Laine
69f3da832f trusty: support secure storage in system-ext
Bug: 355194622
Test: CF gets booted with KeyMint TA in VM
Change-Id: I3708ac572068162ca57c0e9b287296cea73215a7
2024-09-25 06:46:54 +00:00
Treehugger Robot
bb8dbd6b07 Merge "Update struct to include far and elr on the NS side" into main 2024-09-24 10:09:53 +00:00
Alice Wang
179d341569 Merge "trusty: utils: trusty-ut-ctrl: add to system_ext" into main 2024-09-24 06:45:08 +00:00
Armelle Laine
d26f39ab0e trusty: storage: proxy: FS_READY property setting on vendor only
Bug: 367965796
Test: launch_cvd --noresume --console=true \
      --extra_kernel_cmdline='androidboot.selinux=permissive' \
      --secure_hals=guest_keymint_trusty_insecure
Change-Id: I4d5ea1762f7cf9edfd8cbc00e2aec13caae965f4
2024-09-23 23:38:14 +00:00
Armelle Laine
4f0e3eb6f2 trusty: utils: trusty-ut-ctrl: add to system_ext
Bug: 367423387
Test: atest VtsHalSecureStorageTargetTest

Change-Id: I70a8a9108c7399f99bfdf26b00c5fbd1fcb039c6
2024-09-23 23:37:09 +00:00
Armelle Laine
2ea6ecf71d trusty: keymint: rename trusty_ipc_dev property
matching the naming convention for a system service property

Bug: 309007107
Test: launch_cvd --noresume --console=true \
      --extra_kernel_cmdline='androidboot.selinux=permissive' \
      --secure_hals=guest_keymint_trusty_insecure
Change-Id: I7c31f36dcac49d60469de44ce75c9b46a333786e
2024-09-19 14:25:45 +00:00
Snehal
f3f3845b44 Update struct to include far and elr on the NS side
Bug: 354119614

Change-Id: I88a5f08ead9a536e12bc4a3e8d701e01aa8b8f29
2024-09-18 14:31:04 +00:00
Arve Hjønnevåg
ced57af116 trusty: keymint/gatekeeper: Pass device name from init scripts
If the ro.hardware.trusty_ipc_dev.gatekeeper (respectively .keymint) property is set, pass it as the device name to the gatekeeper (respectively keymint) HALs.

Test: "setprop ro.hardware.trusty_ipc_dev VSOCK:2048:1" and restart HALs
Change-Id: I0947e532ac70ce1821cec49897f21ca10e1af03e
2024-09-10 04:00:09 +00:00
Treehugger Robot
e57d3f2110 Merge "trusty: Add host build for rpmb_dev" into main 2024-09-09 19:45:16 +00:00
Alice Wang
d694b61591 [km] Include non-secure KM HAL with Trusty VM in /system_ext
Bug: 355194622
Test: launch_cvd --noresume --console=true \
     --extra_kernel_cmdline='androidboot.selinux=permissive' \
     --secure_hals=guest_keymint_trusty_insecure
Change-Id: I1ecdca049cfd6d33caf98f95d1260083bed2c155
2024-09-04 09:29:00 +00:00
Alice Wang
b9b2830c81 [km] Add a new rust binary for non-secure KeyMint host
The new binary sets non-secure RoT for keymint. The non-secure
version will be used on cuttlefish.

Bug: 355194622
Test: CF is gets booted with KeyMint TA in VM
Change-Id: Iff202c6d4bb70dabeb866b4f3fbc18c006bb219e
2024-08-29 11:25:27 +00:00
Stephen Crane
3fa77a15c5 trusty: Add host build for rpmb_dev
Building rpmb_dev as a host tool in soong makes it easy to package for
acloud, rather than building it in the Trusty build system and uploading
that to the remote instance.

Test: m
Bug: 354771029
Change-Id: I3b7f623238957ae3b25524d424025fd08f805657
2024-08-22 21:09:14 +00:00
Arve Hjønnevåg
dfeaa4e32b trusty: libtrusty-rs: Add vsock support
Bug: 298705967
Test: Manual run android.hardware.security.keymint-service.rust.trusty -d VSOCK:2048:1

Change-Id: I2aa5660c3c86fed53420b874de3ef6db9dc22f96
2024-08-07 11:27:27 +00:00
Arve Hjønnevåg
d5359abe11 trusty: libtrusty: Add vsock support
Add support for connecting to a vsock port that multiplexes trusty
services. The first vsock packet contains the tipc port name. To enable
this mode, pass "VSOCK:<cid>:<port>" as the device name string (where
<cid> and <port> is replaced with the cid and port numbers you want to
connect to).

Test: manual - ran storageproxyd and storage test with new option
Bug: 298705967
Change-Id: I9b75244ca38b7eb69ed7fc19b27aa309d0f7ed13
2024-08-06 13:06:24 +00:00
Arve Hjønnevåg
b4158e2599 trusty: keymint: Add commandline option to specify device name
Bug: 300338484
Test: VtsAidlKeyMintTargetTest (emulator subset)
Change-Id: Ibaa89dd0a3db65565101c0a37303c7155f999fb7
2024-07-31 08:21:53 +00:00
Arve Hjønnevåg
31154a9e60 trusty: keymaster: Add commandline option to specify device name
Bug: 300338484
Test: VtsAidlKeyMintTargetTest (emulator subset)
Change-Id: I7ca0a7e72b55fcf9e9b015f68425b67c778aca9e
2024-07-31 08:21:50 +00:00
Arve Hjønnevåg
2fea1dd4ab trusty: gatekeeper: Add device option
Add commandline option to specify the trusty device to use.

Bug: 300338484
Test: VtsHalGatekeeperTargetTest
Change-Id: Ib2ef34dfc104c65119a98937280ae9db74417766
2024-07-31 08:21:47 +00:00
Treehugger Robot
69c7daf1a7 Merge "Add trusty_rkp_set_uds_cert for UdsCert provisioning" into main 2024-07-29 15:53:54 +00:00
Tommy Chiu
5c1378a5ff Add trusty_rkp_set_uds_cert for UdsCert provisioning
Bug: 330791928
Test: trusty_rkp_set_uds_cert /data/rkp_uds_cert_test.xml
Change-Id: I368be346197099ff6d3fe7a09d666791faada040
2024-07-23 15:41:45 +00:00
Mike McTernan
9c77e66d56 storageproxy: set a property when secure storage becomes rw
Bug: 350362101
Test: ABTD
Change-Id: I877a62e5c6337f31ffe63a4fd3cdeb54b69a8ae6
2024-07-18 14:41:43 +01:00
Seth Moore
b1a58e12dd Use shared trusty OWNERs file
Change-Id: I20f118c39927f56890a37eaa059249db5285e59b
2024-05-28 23:00:10 +00:00
Snehal
4334a6320c [Trusty][Metrics] Update struct to add is_crash on the NS side
Bug: 340509044

Change-Id: I4547286c5cefa3caaf1bf1c30f205145fb5e689c
2024-05-17 17:01:32 +00:00
Treehugger Robot
d6f6d0e6e3 Merge "[Trusty][Coverage] Update counter to let Trusty know coverage dump has been read" into main 2024-05-07 19:45:05 +00:00
Snehal
b47c9b065f [Trusty][Coverage] Update counter to let Trusty know coverage dump has been read
Bug: 339194547

Change-Id: I075742200998e837e59ba9c24e4dca8b5d4d1199
2024-05-07 15:07:35 +00:00
Snehal
030dd05027 [Coverage] Fix coverage bug in which extra garbage is being written
Bug: 296356127

Change-Id: I2e4128af461b297bbe170c015dc52899089e9b8b
2024-04-30 14:32:07 +00:00
Donnie Pollitz
4f75b6699c storageproxyd: Fix x86 builds
Background:
* printf format specifiers and size_t literal were invalid.

Bug: 324989972
Test: Builds
Change-Id: I408cfe0d41fb6850d5dcfe9963bb88be48f4a0c6
Signed-off-by: Donnie Pollitz <donpollitz@google.com>
2024-04-22 22:42:54 +02:00
Donnie Pollitz
63ef65c138 Merge "storageproxyd: Add arguments for storage mapping and max file" into main 2024-04-22 18:20:44 +00:00
David Drysdale
8005cfa7e4 Warn that reboot might be needed after setting IDs
Test: compile
Change-Id: Iac93f6a60df7e1a9f89183deabb37e0efc16df91
2024-04-17 16:27:49 +01:00
Donnie Pollitz
636234bebf storageproxyd: Add arguments for storage mapping and max file
Background:
* -f = Allows mapping files in the format `-f file:backing_file`.  This
  can be used for mapping secure storage files like `0` and `persist/0`
  to block devices.  Storageproxyd will handle creating the appropriate
  symlinks in the root datapath
* -m = Allows specifying the the max size constraint for file backed storages.
  The constraint is chosen by giving a file, this allows for passing a
  block device for which a max file size can be queried.  File based
  storages will be constrained to that size as well.

Bug: 324989972
Test: File sizes are restricted as specified, and mappings are created
Change-Id: I8ff550afafbd372288daa9e27c4db3451948b25d
Signed-off-by: Donnie Pollitz <donpollitz@google.com>
2024-04-15 16:26:34 +00:00
Raphaël Hérouart
20c3933ed4 Merge "lib/trusty: tipc-test should not print results to error stream" into main 2024-04-08 11:07:23 +00:00