Commit graph

424 commits

Author SHA1 Message Date
Mike McTernan
5647c0b738 trusty: storageproxyd: fix logging of freed path pointer
Bug: 316859216
Test: build.py
Change-Id: I09557d43cda13e21175ba6fceeb806ec1f9115e1
2023-12-18 11:03:36 +00:00
Mike McTernan
b22e5bcf60 trusty: apploader: fail specifically if app package is 0 bytes
Replace assert with check and log message.  Also log more about the request if DMA heap allocation fails.

Bug: 315283243
Test: boot to home
Test: touch x && trusty_apploader x
Change-Id: Ic075809fd2a6b09d9c4e8dff986709c4deae8fb7
2023-12-07 12:16:09 +00:00
Owner Cleanup Bot
3d37da29e7 Remove marcone@google.com from trusty/OWNERS
This suggested change is automatically generated based on group
memberships and affiliations.
If this change is unnecessary or in error, vote CR -1 and the bot
will abandon it. Vote CR +1/2 to approve this change.

See the owner's recent activity for context:
https://android-review.googlesource.com/q/marcone@google.com

To report an issue, file a bug in the Infra>Codereview component.

Change-Id: Ia8f5d261cbfc7328c7dffa0bdf92a5732ba3eee8
2023-11-30 16:37:53 +00:00
David Drysdale
9d6d134e44 Merge "Add tipc fuzzer for KeyMint/Rust" into main 2023-10-19 08:31:09 +00:00
Kalesh Singh
d469fdcd93 Merge "trusty: Remove explicit page-alignment of mmap and dmabuf allocations" into main 2023-10-12 22:19:26 +00:00
Treehugger Robot
58e7eda0b0 Merge "libtrusty: Remove PAGE_SIZE usage" into main 2023-10-12 21:32:33 +00:00
Treehugger Robot
8eda323bc2 Merge "trusty: tipc_fuzzer: Remove use of PAGE_SIZE" into main 2023-10-12 21:11:25 +00:00
Kalesh Singh
623d140cc0 trusty: Remove explicit page-alignment of mmap and dmabuf allocations
bionic hard codes the PAGE_SIZE macro as 4096. This is going away as
Android begins to support larger page sizes.

trusty uses PAGE_SIZE to round up the allocation size of the DMA
buffers and mmap sizes. This is not explicitly needed since the kernel
will always give you a page-aligned and page-sized multiple allocation
when allocating a dmabuf or mmap-ing.

Remove this PAGE_SIZE usage from TrustyApp, app_fuzzer, coverage,
line-coverage, modulewrapper.

Bug: 294914413
Test: Boot test on 16k device
Change-Id: Iad922e0a152cb80db2e59e696d7556602fd17d67
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-12 13:50:31 -07:00
Kalesh Singh
efeb096c40 libtrusty: Remove PAGE_SIZE usage
bionic provides PAGE_SIZE macro which happens to also match the
4096 chunk size in the tips_test.

PAGE_SIZE is being removed as no other libc provides this and
Android is moving towards being page-size-agnostic.

Use 4096 chunk size for tipc-tests; fix incorrect size in
munmap cleanup; and add failure log for send-fd test.

Test: tipc-test -t "send-fd"
Bug: 294914413
Change-Id: I7e5ec6480fff6bc1b4e8eed57eadf081cf82a72f
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-12 13:35:29 -07:00
Kalesh Singh
bbc4bc54f2 keymaster: Remove usage of PAGE_SIZE
bionic provides PAGE_SIZE macro which happens to also match the
size keymaster send buffer (4096) and half the size of the recv
buffer.

PAGE_SIZE is being removed as no other libc provides this and
Android is moving towards being page-size-agnostic.

Use a 4096 constant instead.

Test: Boot 16k device
Bug: 294914413
Change-Id:  I2dc10b48811e24d25ba08cfe4ffb514e94d42a8f
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-12 20:03:08 +00:00
Kalesh Singh
5a2b8794fc trusty: tipc_fuzzer: Remove use of PAGE_SIZE
tipc_fuzzer writes random data of length 'size' and then
attempts to read back data up to 'TIPC_MAX_MSG_SIZE' in length.

Since 'size' is unrestricted we can always write more than the
subsequent read; and in effect the fuzzer only checks that we
can read something.

Remove the read buffer's dependency on PAGE_SIZE.

Bug: 294914413
Test: mma
Change-Id: I909b49fda4e6ebf49f69b3c09ac29ff8629215ef
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-12 20:02:34 +00:00
Treehugger Robot
c2671853ae Merge "rpc_binder: Change trusty_tipc_fuzzer to support multiple connections and messages" into main 2023-10-10 22:13:42 +00:00
Yurii Shutkin
f75464d65e acvp: handle flush commond in modulewrapper as stated in BoringSSL.
Change-Id: Ife655f0764851cf2d9677abd507daec3f531031e
Bug: 287626912
Test: ACVP test
2023-10-09 15:37:29 +02:00
Elliott Hughes
716ff7b55a s/master/main/
Test: treehugger
Change-Id: Iabb23436d92686b934f2f2609217714b64ae75de
2023-10-04 23:31:09 +00:00
Snehal
6a12d23eab Remove ambgiuity in format specifier
Bug: 302163991

Test: m trusty-coverage-controller

Change-Id: I26318eeb4a6770bd01d3c677ca3cf5c76ce33fa0
2023-09-27 12:29:07 +00:00
Khyber Sen
589c8d1e44 rpc_binder: Change trusty_tipc_fuzzer to support multiple connections and messages
This changes `trusty_tipc_fuzzer` to be more like the existing binder rpc_fuzzer,
which opens and closes multiple connections and sends multiple messages in a single fuzz input.

The max number of connections is controlled by the define `TRUSTY_APP_MAX_CONNECTIONS`,
which defaults to `1`, thus keeping the existing behavior for now.

In the next CL, I'll add more fuzzers with `-DTRUSTY_APP_MAX_CONNECTIONS=10` instead.

Test: Build and run in trusty emulator
Change-Id: I9692e4d0295052a8da2204f63be9e52939e70ac3
2023-09-25 23:18:33 +00:00
Ryan Prichard
532a608f58 Merge changes I7790dde8,I065907a5,Id2e82024 into main
* changes:
  Add missing <assert.h> include
  Add missing <functional> and <vector> includes
  snapuserd_test: don't discard result of std::async
2023-09-22 19:42:45 +00:00
Ryan Prichard
87c90e7b65 Add missing <assert.h> include
Bug: 175635923
Test: m MODULES-IN-system-core-trusty
Change-Id: I7790dde8eba948cf95cb14dd2b436c3f6f88765a
2023-09-21 19:44:47 -07:00
Dan Shi
43c87b3291 Remove unnecessary keyword setting
These 2 tests can run on aosp cf.

Bug: 300519349
Test: atest presubmit check
Change-Id: I8ee41c2abe464be2c2ee4537de5edf86308183aa
2023-09-20 13:26:18 -07:00
Dan Shi
19224ed589 Merge "Move CF only tests to CF test mapping suite" into main 2023-09-20 20:20:35 +00:00
Dan Shi
a95ed0aeac Move CF only tests to CF test mapping suite
This change doesn't modify presubmit coverage, the tests will still
run in the lab as test mapping suite, just on a different ATP test
config that dedicated to tests can only run on CF (not aosp_cf), on
git_main branch.

Bug: 300519349
Test: atest presubmit check
Change-Id: Ib179c034dc58f8d8a763d374af0d103baf51343b
2023-09-20 18:27:43 +00:00
Tomasz Wasilczyk
2b1a0599c4 Don't depend on String8 cast to C string
Bug: 295394788
Test: m checkbuild
Change-Id: I5b86ae56250d409a23ab3f2bc72b725bcf6ab23e
2023-09-20 15:11:54 +00:00
Snehal
6e074fc31e Add UUIDs to profraw filenames
Bug: 295866435

Change-Id: Ie9390f412c70202d1583e29ac83c30778ae02f70
2023-08-18 09:43:15 +00:00
Snehal Koukuntla
7cc9edd55c Merge "Change name to trusty-coverage-controller" into main 2023-08-16 09:15:09 +00:00
Snehal
b702fddd2e Change name to trusty-coverage-controller
Test: builds and passes tests

Bug: None

Change-Id: I89eec23312f79f4da43c491ce58aa4f246c7ab34
2023-08-16 09:14:32 +00:00
Treehugger Robot
49dc9d1233 Merge "Add mikemcternan@ to OWNERS" into main 2023-08-15 16:21:57 +00:00
David Drysdale
cedcb4cd92 KeyMint HAL: process destroyAttestationIds
Bugs: 283049310
Test: VtsAidlKeyMintTargetTest using disabled test
Change-Id: I545511a7a701faf8e82dff9c169c3738f2c30e6d
2023-08-09 11:32:52 +01:00
Snehal
7728c6c998 Add mikemcternan@ to OWNERS
Change-Id: Ia414e191eab2b2e3139b94fa8c94ea54f4fbf308
2023-08-07 18:32:33 +00:00
Snehal Koukuntla
6ac2c1693d Merge changes from topic "coverage-build" into main
* changes:
  Add Coverage controller
  Coverage library on the NS side for the coverage controller
2023-08-07 10:53:44 +00:00
Snehal
806e70bb94 Add Coverage controller
Bug: 289523068

Change-Id: I5b36c274acc7da4e2d6b9cf91409a7b1af5f0d34
2023-08-04 08:54:52 +00:00
Snehal
ed34b6e232 Coverage library on the NS side for the coverage controller
Bug: 289520358

Change-Id: I6c2c0e5db9e8d9a0edec93d2fb123d185c7c4416
2023-08-04 08:54:32 +00:00
Treehugger Robot
545f3e0d35 Merge "trusty: keymint: Statically link Rust deps" into main 2023-07-27 23:29:48 +00:00
Matthew Maurer
cac69b6cb8 trusty: keymint: Statically link Rust deps
Vendor libraries can be linked dynamically now, but until more Rust
components are using it, static is more efficient.

Bug: 292062611
Test: TH
Change-Id: I3708f5fac1ace797b6233811adf3ec71218d5738
2023-07-27 22:36:28 +00:00
Treehugger Robot
406d43397c Merge "Add safety comments." into main 2023-07-25 07:00:16 +00:00
Stephen Crane
b05b870671 storageproxyd: Start only a single binder thread
We only need a single binder thread to receive notifications, so we
should set the thread pool max to 0 rather than 1. startThreadPool()
starts one thread + the max count.

Test: m storageproxyd
Bug: 281951047
Fixes: 292030372
Change-Id: I53a90eaa2aa69469fd3a00b6da0d7061318c8ba9
2023-07-21 19:23:45 +00:00
Andrew Walbran
f580fe5799 Add safety comments.
These will soon be required by a lint.

Bug: 290018030
Test: m rust
Change-Id: I0b25bcaa18d167fb9c2d63e637833d4935dc8ff4
2023-07-21 19:13:48 +01:00
Stephen Crane
fb92cd3c22 storageproxyd: Start binder thread pool
The Trusty storage proxy requires that the suspend service is started to
acquire a wakelock for UFS RPMB operations. Without the binder thread
pool running, starting this service results in at least a 1s polling
delay. This change ensures that we start the thread pool before handling
any RPMB operations, so acquiring the wakelock will complete as soon as
the service is ready without needing to poll once per second.

Test: m storageproxyd
Test: Artificially delay suspend_service to check if we poll
Bug: 281951047
Change-Id: I1a4cdd48d57201b0cf9c24523d22e5bdbcea376a
2023-07-19 18:37:52 +00:00
David Drysdale
f009f927d0 Merge "Set IMEI in provisioning helper" 2023-05-18 06:24:32 +00:00
David Drysdale
e556021b52 Set IMEI in provisioning helper
Borrow the code from AttestKeyTest.cpp (in KeyMint VTS) for determining
the devices IMEI value(s), and use that as default value.

Also update to use the newer provisioning message if the second IMEI is
set.

Test: provision a test device
Change-Id: Ie8e183dc50ac9107c2c2c2966c591e8b6022fd20
2023-05-17 18:12:00 +01:00
David Drysdale
880656af81 Add tipc fuzzer for KeyMint/Rust
Also update fuzz config for the KeyMint/C++ fuzzer

Test: trusty_keymint_fuzzer
Change-Id: Ic96c572ff6d154afefba280667c23e4e324d7751
2023-05-16 12:28:22 +01:00
Mike McTernan
4066926374 confirmationui:fuzzer: update contact details
Bug: None
Test: make trusty_confirmationui_tipc_fuzzer
Change-Id: Ie81bf916c41498abc226389f63b22b57da55d446
2023-05-16 09:05:29 +01:00
Armelle Laine
8185610aa4 trusty: Add trusty stats test
Test an Android Daemon consuming IStats.aidl vendor atoms
from Trusty.

Test: /data/nativetest64/vendor/trusty_stats_test/trusty_stats_test
Bug: 259517277
Change-Id: I7486db5494a8fd4a995ec8a1a865e6e5fa515dfc
2023-03-20 21:08:24 +00:00
Andrei Homescu
2de07e82f2 trusty: Add IStatsSetter interface
Add android.trusty.stats.nw.setter.IStatsSetter interface
for sending an IStats interface from Android to Trusty.

Bug: 259517277
Test: /data/nativetest64/vendor/trusty_stats_test/trusty_stats_test
Change-Id: Ie3976cdf069dd47b51477a70eb597c76de79f522
2023-03-17 20:14:55 +00:00
Tri Vo
3aa6c71d43 Merge "Remove RemoteProvisioner" 2023-03-14 03:54:17 +00:00
Tri Vo
ee45e23798 Remove RemoteProvisioner
RemoteProvisioner is deprecated in favor of RKPD

Bug: 273325840
Test: m
Change-Id: I71abe9e0173ef399f9bca65814995aa7e66f1ebe
2023-03-13 13:55:32 -07:00
Max Bires
fea7f85a4e Add RKPD unit tests to trusty keymaster changes.
This ensures that full integration testing is done when changes are made
to the KM/IRPC client HAL service for Trusty.

Test: The tests are run.
Change-Id: Id22bbac119f76653a5b2338e97f28032822741f0
2023-03-08 17:40:18 -08:00
Donnie Pollitz
dedd899baa Add KM_SET_ATTESTATION_IDS_KM3 to enum list
* This command is needed to support provisioning KeyMintv3 attestation IDs

Bug: 265381212
Test: Ran KM Vts
Change-Id: I9b9bf3753b90c58096fa85a4e7303b47eaafe31f
Signed-off-by: Donnie Pollitz <donpollitz@google.com>
2023-02-16 10:59:47 +01:00
Treehugger Robot
368a908334 Merge "Fastboot: Add new TEXT message to protocol to handle long lines." 2023-02-15 11:49:24 +00:00
Raphael Herouart
99097cc020 Fastboot: Add new TEXT message to protocol to handle long lines.
Trusty Benchmarks need to be evaluated in ABL which is much more
controlled than linux. However fastboot prints evry atomic message from
trusty/abl on its own line starting with "(bootloader)"

Bug: 263454481
Test: - "fastboot oem trusty runtest trusty.hwrng.bench"
Change-Id: I99847a8cc54457c8ec809e219736325dce0ac891
2023-02-14 19:58:42 +00:00
Treehugger Robot
d14a7551d5 Merge "Convert Gatekeeper from HIDL to AIDL" 2023-02-14 17:48:17 +00:00