Commit graph

284 commits

Author SHA1 Message Date
Tri Vo
fcfa3cd9b5 trusty: Use a simple TIPC fuzzer for ConfirmationUI
Bug: 174402999
Test: trusty_confirmationui_tipc_fuzzer
Change-Id: I9c86a12cba75a2b5ae78621373aa39f299abfe0a
2021-03-02 12:20:10 -08:00
Tri Vo
5c1d2e1dff trusty: Apploader fuzzer
Bug: 181630912
Test: trusty_apploader_tipc_fuzzer
Test: trusty_apploader_app_fuzzer
Change-Id: I1cc2329ca2a4e983f6ded45810d4c34e1433c5b0
2021-03-01 23:29:03 -08:00
Tri Vo
123c038e1a trusty: Fuzz keymaster TA using generic TIPC fuzzer
Bug: 171750250
Test: trusty_keymaster_fuzzer
Change-Id: I94a1cc28276d198f698906212a8a5d15ac07ae1e
2021-02-27 14:09:06 -08:00
Tri Vo
e4a80fe066 trusty: Fuzz gatekeeper TA using generic TIPC fuzzer
Bug: 171750250
Test: trusty_gatekeeper_fuzzer
Change-Id: Ib3f40e7d2c01cdd2ca8df35f4b84234ddf7dbe50
2021-02-26 20:24:58 -08:00
Tri Vo
f41fee5879 trusty: Generic parameterizable TIPC fuzzer
Bug: 171750250
Test: trusty_test_fuzzer
Change-Id: I57c4aacc6725689d16dd88db2faa8ead59bcc49a
2021-02-26 19:14:47 -08:00
Tri Vo
3c8a004a8d trusty: coverage: Add UUID helpers
Function to parse string was borrowed from Trusty.

Bug: 171750250
Test: trusty_test_fuzzer
Change-Id: I8430579f142db2c174874aff373bce6bb868de31
2021-02-26 19:14:47 -08:00
Treehugger Robot
1d9764209f Merge "trusty: Export ConfirmationUI helper classes" 2021-02-26 22:31:59 +00:00
Tri Vo
e3cdd2945a Merge "trusty: Add keymaster fuzzer corpus" 2021-02-25 23:18:08 +00:00
Tri Vo
ec1d6caec3 Merge "trusty: Increase maximum number of coverage counters" 2021-02-25 06:22:39 +00:00
Arve Hjønnevåg
06ac3e24fe Merge "trusty: Fix apploader short option" 2021-02-25 04:32:52 +00:00
Stephen Crane
0ecf0530db trusty: Increase maximum number of coverage counters
The keymaster TA has 30841 distinct coverage counters, so 0x4000 counter
slots is not enough to handle this TA. Increase maximum number of
coverage counters to 0x8000.

Test: adb shell trusty_keymaster_fuzzer
Bug: 175918322
Change-Id: I879d18538edb4933a4205c8f73b7939ddbf69e37
2021-02-24 15:37:10 -08:00
Stephen Crane
885295f070 trusty: Add keymaster fuzzer corpus
Add an initial corpus for the keymaster fuzzer derived from running the
keystore2 unittests.

Test: adb shell "cd /data/fuzz/arm64/trusty_keymaster_fuzzer/ && ./trusty_keymaster_fuzzer corpus"
Bug: 175918322
Change-Id: I839bb9bacee1800cf2da25aedbb4ce3eccf16cba
2021-02-24 15:34:35 -08:00
Tri Vo
7280acc996 Merge "trusty: fuzz: Link to libtrusty dynamically" 2021-02-23 20:35:01 +00:00
Tri Vo
abd86f8f98 trusty: Export ConfirmationUI helper classes
And fix namespaces.

Bug: 174402999
Test: m
Change-Id: I54dcc92d8c153d0fa2b10b2679a9a871699de8b1
2021-02-23 11:31:35 -08:00
Tri Vo
cb89889af3 trusty: fuzz: Link to libtrusty dynamically
libtrusty can be depended on by multiple thing in a fuzzer's
dependencies tree. It's no longer convenient to link to statically.

Leave tests statically linked. Test infra doesn't seem to handle shared
test libs correctly.

Bug: 171750250
Test: trusty_test_fuzzer libtrusty_coverage_test
Change-Id: Ic7d003151e43fb5bab63354fd42ea9667332743f
2021-02-23 10:23:37 -08:00
Tri Vo
3e9dbccde6 Merge "Update OWNERS based on Trusty team membership" 2021-02-23 05:56:19 +00:00
Tri Vo
eefaf0bb3a Update OWNERS based on Trusty team membership
Change-Id: I2a940f57b3f5da67e12d4f89f9980036d47be321
2021-02-22 14:51:14 -08:00
Greg Kaiser
3e02a60412 trusty: Remove redundant check
This repeats a check in the lines immediately before it.

Test: TreeHugger
Change-Id: I47ac9f359018b87bc283657eddb75ad3d175244e
2021-02-21 10:31:40 -08:00
Stephen Crane
4778579283 Trusty: Add BoringSSL modulewrapper for ACVP
In order to validate the BoringSSL implementation in Trusty using ACVP,
we need a modulewrapper tool that forwards requests to Trusty and back
to the ACVP tool. Adds this tool, which interfaces with the Trusty ACVP
testing service.

Test: make trusty_acvp_modulewrapper
Test: adb shell "acvptool -wrapper trusty_acvp_modulewrapper -json vectors/ACVP-AES-CBC"
Bug: 173805789
Change-Id: I3028e44c00f8e315dfd94ea34c004bbd25fab788
2021-02-19 17:27:46 -08:00
Bob Badour
d69ad69a93 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id740a7d2884556081fdb68876584b25eb95e1bef
2021-02-19 12:59:05 -08:00
Tri Vo
19b62a5182 trusty: ConfirmationUI HAL<->TA IPC using shared memory
Bug: 148421469
Test: VtsHalConfirmationUIV1_0TargetTest
Change-Id: I686150b64da3d3e95618f29e396990660f2054ba
2021-02-17 11:10:14 -08:00
Tri Vo
83e66f792e Merge changes I9e4cbf11,I41cde13a
* changes:
  trusty: Allow fuzzing without coverage
  trusty: Fix up error messages
2021-02-11 22:39:29 +00:00
Andrei Homescu
909beaeae3 trusty: Fix apploader short option
Fix a typo in one of the short command line options
for the Trusty application loader. The typo caused
the tool to incorrectly accept the -s short option
and ignore it, but not accept the -D option which
is the short version of --dev.

Bug: 115420908
Test: m
Change-Id: I9d03f8dd20adedbd820621ae8f9b4d13137041ed
2021-02-11 12:55:00 -08:00
Tri Vo
19eccb4f51 trusty: Allow fuzzing without coverage
Bug: 171750250
Test: m
Change-Id: I9e4cbf11fd223092f9ad800b35d0502c27f71e8f
2021-02-10 16:46:24 -08:00
Tri Vo
ce812a22ca trusty: Fix up error messages
Bug: 171750250
Test: m
Change-Id: I41cde13a891da36c85df6a451b2d051c18365797
2021-02-10 13:31:24 -08:00
Arve Hjønnevåg
7b204ac4ca Merge "trusty: Android part of dynamic app loader" 2021-02-02 01:39:56 +00:00
Andrei Homescu
08d66c5036 trusty: Android part of dynamic app loader
Implement the Android tool that uploads Trusty application package files
to the Trusty app loader.

Bug: 115420908
Test: trusty_apploader boot-start-srv.app
Change-Id: Ie21b8cad749fd565579483944a8b71e861d3a51a
2021-02-01 14:00:35 -08:00
Marco Nelissen
003bf066b2 Merge "Send DeleteUsers/DeleteAllUsers to Trusty" 2021-01-30 22:55:43 +00:00
Shawn Willden
657f71cd26 Add attestation key to generate/import messages
Bug: 171845787
Test: Build
Change-Id: I59bd25dc8998668f0ea2053f3e647bf6cc58885a
2021-01-28 11:56:14 -07:00
Marco Nelissen
53dc3c99b7 Send DeleteUsers/DeleteAllUsers to Trusty
Actually route the DeleteUsers/DeleteAllUsers calls to Trusty,
instead of immediately returning ERROR_NOT_IMPLEMENTED.

Bug: 160731903
Test: "atest VtsHalGatekeeperV1_0TargetTest"
      manual testing with added instrumentation
Change-Id: I11fdaa0812fdfbc9b926611b15d84513ab13b18e
2021-01-25 17:55:19 -08:00
ichihlu
9ee8a75e6b Secure DPU: add folder for common headers
The header SecureDPU.h is moved out from the device specific folder as
it can be shared for different devices.

Bug: 176508588
Test: Pass TUI VTS test on the emulator.
Change-Id: I7695b49c4f7a247b570ced61145471efef3d0a3d
2021-01-22 06:31:37 +00:00
Matthew Maurer
c4abbe6427 trusty: keymaster-hal: Reconnect on failed VERSION
Trusty Keymaster will currently disconnect the client on an invalid
message. This includes the newly introduced GET_VERSION2 message.

While in the future we could change this behavior, this is a backcompat
path and so we can't assume a changed Trusty. Reconnect on failed
GET_VERSION2 before attempting version negotiation.

Bug: 177843218
Test: Set PIN on device using older Trusty
Change-Id: Ie60e4aaafa43e375797e6288b97834cac42413f4
2021-01-20 13:21:37 -08: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
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
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
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
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
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
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
936557b6f0 Merge "Revise KeymasterMessage versioning system" 2021-01-05 22:40:06 +00:00
Shawn Willden
db089205aa Revise KeymasterMessage versioning system
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: Ibea104c39942c6c88523688306a030f40e9b150f
2020-12-22 20:33:13 -07: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
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
Tri Vo
56bcb02b6e Merge "trusty: Retrieve coverage PCs from coverage record" 2020-12-15 20:15:08 +00:00
Stephen Crane
e962930d19 trusty: Retrieve coverage PCs from coverage record
Adds the ability to retrieve and save program counter information from
the trusty coverage record data. PC information is saved to a .sancov
file, parseable by the LLVM sancov tool. Sancov can then symbolize and
display this coverage information for consumption by humans.

Adds a sancov dump to the libtrusty_coverage_test for testing.

Bug: 175221942
Test: atest libtrusty_coverage_test
Test: Retrieve sancov file and manually symbolize with sancov
Change-Id: I342ea2ca9abb87986b2904ff69415544ee6070fc
2020-12-14 22:06:13 -08:00
Treehugger Robot
00ed8bdddb Merge "Update message versionioning system" 2020-12-15 01:25:12 +00:00
Tri Vo
5a611cb834 Merge "trusty: fuzz: Link libtrusty_test statically" 2020-12-14 20:39:09 +00:00
Shawn Willden
4f45dc3a7e Update message versionioning system
Bug: 171845787
Test: Build
Change-Id: Ie769113070a8a755a268f65e36384fe333c798b6
2020-12-13 10:56:50 -07:00
Tri Vo
cafdd7c335 trusty: fuzz: Link libtrusty_test statically
Simplifies development flow because libtrusty_test.so doesn't need to be
pushed with the fuzzer.

Bug: 171750250
Test: m trusty_gatekeeper_fuzzer && adb sync data && \
adb shell /data/fuzz/arm64/trusty_gatekeeper_fuzzer/trusty_gatekeeper_fuzzer
Change-Id: I7c83b5784ede4881dcd9c2dd33c97bf49fcde6ff

Change-Id: Iba60f03000bfca15b00e484ef3a168604c65554a
2020-12-11 13:19:55 -08:00
Wenhao Wang
bf40c084cc trusty: Add ExtraCounters to Confirmationui Fuzzer
Add ExtraCounters to Confirmationui fuzzer so that the fuzzer can
grab the coverage information of the Confirmationui TA.

Bug: 174402999
Bug: 171750250
Test: /data/fuzz/arm64/trusty_confirmationui_fuzzer/trusty_confirmationui_fuzzer
Change-Id: I2e287281e7c8100f0d48413fbe0ff99d397a74c1
2020-12-11 10:56:40 -08:00
Wenhao Wang
36d45bbfd5 Merge "trusty-ut-ctrl: Make it as binary" 2020-12-02 03:28:58 +00:00
Treehugger Robot
41c2e6286e Merge changes Ie9da525c,I9911f02c,Iad18af1f,I5f432a3d
* changes:
  trusty: provide coverage to gatekeeper fuzzer
  trusty: fuzz: Example TA fuzzer
  trusty: fuzz: Helper lib for libFuzzer extra counters
  trusty: coverage: Coverage client library
2020-12-01 20:20:08 +00:00
Tri Vo
a1008a1edf trusty: provide coverage to gatekeeper fuzzer
Bug: 171750250
Test: /data/fuzz/arm64/trusty_gatekeeper_fuzzer/trusty_gatekeeper_fuzzer
Change-Id: Ie9da525c0dcb6c9c5ed2f50396c0065e3a567d22
2020-11-30 20:09:08 -08:00
Tri Vo
680fc001b8 trusty: fuzz: Example TA fuzzer
Bug: 169776499
Test: /data/fuzz/arm64/trusty_test_fuzzer/trusty_test_fuzzer
Change-Id: I9911f02cb49c39f1c3cd89b4e5582e8dfaa645d1
2020-11-30 20:09:07 -08:00
Tri Vo
a67840f998 trusty: fuzz: Helper lib for libFuzzer extra counters
Bug: 169776499
Test: /data/nativetest64/libtrusty_coverage_test/libtrusty_coverage_test
Change-Id: Iad18af1f0404fc47bef481955c7a4292ef3a24ec
2020-11-30 20:09:02 -08:00
Tri Vo
5b40e89894 trusty: coverage: Coverage client library
Bug: 169776499
Test: /data/nativetest64/libtrusty_coverage_test/libtrusty_coverage_test
Change-Id: I5f432a3df04fe7b0e2940a12f8d28b3d0655791f
2020-11-30 19:39:00 -08:00
Wenhao Wang
0124a59fe4 trusty: Fuzzer for Confirmationui TA
Note: We need to add Confirmationui TA into
TRUSTY_BUILTIN_USER_TASKS to run the fuzzer.

Bug: 174402999
Bug: 171750250
Test: /data/fuzz/arm64/trusty_confirmationui_fuzzer/trusty_confirmationui_fuzzer
Change-Id: I22769782ded05eeedeb111f7537b5ba76e98ce73
2020-11-29 13:03:55 -08:00
Tri Vo
9763f21565 Merge changes Id77b87bb,I56a15c80
* changes:
  trusty: fuzz: make utils lib use libtrusty_test
  trusty: Add libtrusty_test
2020-11-24 20:39:26 +00:00
Tri Vo
90c0e833c9 trusty: fuzz: make utils lib use libtrusty_test
Test: m libtrusty_fuzz_utils
Change-Id: Id77b87bb14f09b29f53c78a4ea89073fbe1c83a1
2020-11-23 12:57:44 -08:00
Sasha Smundak
92500f1d93 The last line should not end with backslash
Bug: 173737347
Test: treehugger
Change-Id: I4cae512e92c228684e9743939e29691e2beabebb
2020-11-19 14:54:24 -08:00
Tri Vo
421de90544 trusty: Add libtrusty_test
Used by tests on the system side of the Treble boundary, e.g. fuzzing

Test: m libtrusty libtrusty_test
Change-Id: I56a15c80eb7c4b9e51f8e59a7cd1abdfc35d8d5a
2020-11-18 12:17:16 -08:00
Tri Vo
27b0b3f770 trusty: wrap syscalls in TEMP_FAILURE_RETRY
Needed to handle EINTR robustly.

Test: m libtrusty
Change-Id: I46a58ae911fd8db3d3528e24edbb6013d807b48c
2020-11-17 19:56:07 -08:00
Tri Vo
b47dbe7eb0 trusty: Reformat libtrusty
Test: m libtrusty
Change-Id: I5eb8413e7581603879de5abcb6de7b1b6d3484c0
2020-11-17 19:55:59 -08:00
Wenhao Wang
450311d91a trusty-ut-ctrl: Make it as binary
Make the trusty-ut-ctrl as binary such that we can put it into
factory image, put it into PRODECT_PACKAGES_DEBUG fro the device.mk

Bug: 152901318
Test: Trusty storage tests
Change-Id: I8229113e7649c25d0a712b2b0964f23c9d41cf26
2020-11-12 16:48:18 -08:00
Stephen Crane
5e3a3ce011 trusty: fuzz: dump trusty kernel logs on crash
Adds an Abort() function to the fuzzer utils library that grabs and
prints the relevant trusty kernel logs before exiting the fuzzer.

Test: /data/fuzz/arm64/trusty_gatekeeper_fuzzer/trusty_gatekeeper_fuzzer
Change-Id: I7741c7e5e0ffdc402e3d3dd9a7e5856e2a640dd2
2020-11-02 10:16:44 -08:00
Stephen Crane
6c0fb906f6 trusty: Add corpus for gatekeeper fuzzer
Test: /data/fuzz/arm64/trusty_gatekeeper_fuzzer/trusty_gatekeeper_fuzzer
Change-Id: I30bb2844972df952d853f0809e2eb8d5b5a1dd9c
2020-11-02 09:58:54 -08:00
Tri Vo
10ffc3417d trusty: Fuzzer for Gatekeeper TA
Test: /data/fuzz/arm64/trusty_gatekeeper_fuzzer/trusty_gatekeeper_fuzzer
Change-Id: If55b93b1a15c5bd9a1148ff54a859635a6e7290c
2020-10-29 18:02:01 -07:00
Tri Vo
e8823ffcb4 trusty: fuzz: Helper library
Test: /data/fuzz/arm64/trusty_gatekeeper_fuzzer/trusty_gatekeeper_fuzzer
Change-Id: Ife058ca25417e6bee4bf593b10a4e7e4000f9f2f
2020-10-29 18:01:59 -07:00
Wenhao Wang
323353413f Merge "rpmb_dev: Switch to RPMB provisioning scheme" 2020-10-10 05:06:56 +00:00
Arve Hjønnevåg
3e7c3504a3 Merge "trusty: keymaster: set_attestation_key: Change wrapped key" 2020-10-06 23:31:38 +00:00
Wenhao Wang
a560b76faa Merge "rpmb_dev: Fix RPMB_REQ_DATA_READ command" 2020-10-03 05:11:27 +00:00
Arve Hjønnevåg
fe090a4686 trusty: keymaster: set_attestation_key: Change wrapped key
Remove WrappedPrivateKey and select wrapped vs plaintext key command
based on format instead.

Bug: 154033394
Test: send wrapped test key. Not yet accepted by trusty
Change-Id: I3b0a29be78f2a8e84ebd990713f66788256d8e3f
2020-10-02 16:55:16 -07:00
Wenhao Wang
62855c3985 rpmb_dev: Switch to RPMB provisioning scheme
Remove the --key option part to disable the initial setting of rpmb key
on the mock rpmb device.
The RPMB provisioning scheme will program the RPMB key into the mock
rpmb device.

Bug: 152901318
Test: Trusty storage tests
Change-Id: I03b9cfbbd10e2e5364405319a57e2ecc4ee0f48e
2020-10-02 12:39:30 -07:00
Wenhao Wang
975491be09 rpmb_dev: Fix RPMB_REQ_DATA_READ command
Add ".check_key_programmed = true." for RPMB_REQ_DATA_READ such that
we can check whether the rpmb key has been programmed before executing
RPMB_REQ_DATA_READ command.

"JEDEC STANDARD Universal Flash Storage (UFS) Version 3.0" specifies
that data access before the key has been programmed should return
“Authentication Key not yet programmed” (0007h)..

Bug: 152901318
Test: Trusty storage tests
Change-Id: I4759fbce5f37234090a22a1d9dc3b38072f6ecaf
2020-10-02 12:32:30 -07:00
Arve Hjønnevåg
0c32a253df trusty: keymaster: Add set_attestation_key
Add tool to provision keymaster attestation keys.

Bug: 154033394
Test: keys from soft_attestation_cert then VtsHalKeymasterV4_0TargetTest

Change-Id: Ic96e9a8676991b3126bbae99118a1f23ee0744a5
2020-09-10 16:43:20 -07:00
Matthew Maurer
0b9a329303 Merge "Add support for tipc_send()" 2020-08-03 19:35:55 +00:00
Matthew Maurer
e251fa32fd Add support for tipc_send()
* Supports sending memfds in addition to data from an iovec
* Also add a basic test called send-fd

Bug: 117221195
Test: Run send-fd with corresponding Trusty application.
Change-Id: I562d2ff744938c868323a016659ca1332f6a576b
2020-08-03 09:30:37 -07:00
Jeff Sharkey
7b21637782 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Change-Id: Iafcccbdbdf3ff1078e87000e2ce560ff09b43f68
2020-07-31 16:36:06 -06:00
Treehugger Robot
71db317340 Merge "Use more inclusive language for #inclusivefixit" 2020-07-28 12:03:43 +00:00
Hongguang Chen
a41111070c Use more inclusive language for #inclusivefixit
Updating language to comply with Android’s inclusive language guidance.

See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: make
Change-Id: I85a9f48fbab79b3b68f00c0af68750c616d815f8
2020-07-27 22:54:22 +00:00
Hongguang Chen
714adb834a Use more inclusive language for #inclusivefixit
Updating language to comply with Android’s inclusive language guidance.

See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: make
Change-Id: I6f1668d1f7925393c72db6ae282003a9ecc723b7
2020-07-27 15:52:32 -07:00
Tri Vo
4e94e5bcfa trusty: spi: Add SPI proxy daemon
Bug: 118762930
Test: /data/nativetest64/trusty-ut-ctrl/trusty-ut-ctrl \
-D /dev/trusty-ipc-dev0 com.android.trusty.swspi.test

Change-Id: I6589009b2570f1101fed73197997d31a454887eb
2020-07-22 11:19:02 -07:00
Matthew Maurer
8f62566566 trusty: rpmb_dev: Prevent desync between rpmb_dev and storageproxyd
The mock RPMB can get out of sync with TD storage blocks in the event of
panic or crash. Making this O_SYNC will prevent this from happening.

Bug: 160723681
Test: None
Change-Id: Ia16dfc88ceae56e4e9724a42ac0db492c0e707a4
2020-07-10 22:09:01 +00:00
Wenhao Wang
469e388e47 trusty:storageproxyd: Fix in_cdb.length setting on send_ufs_rpmb_req
The in_cdb.length (ALLOCATION_LENGTH) must be set in order to send
SECURITY PROTOCOL IN command.

Bug: 143636526
Test: Trusty storage tests
Change-Id: Ie4252e9b19c05825c895ec07f8c9684ae456f6c9
2020-06-12 15:30:08 -07:00
Kenny Root
15351dcf60 Use <fqname> to avoid conflicts
The newer way of specifying the interface is using <fqname> and it also
has the handy side-effect of not causing conflicts when we add the
strongbox implementation to devices.

Test: make # check $OUT for the correct manifest
Change-Id: If8333814723261c4f3de375861ee19a6d922d55f
2020-04-14 14:37:24 -07:00
Matthew Maurer
1010727a48 trusty: keymaster: Remove legacy support
Library based HALs have been deprecated for several years now, and
Keymaster 2 based testing is woefully out of date compared to running
VTS against the modern 3.0 and 4.0 implementations.

Purging these modules and their resulting dependencies will make it
easier for the central system/keymaster repository to move forwards.

Test: mm
Bug: 150239636
Change-Id: Ic2ddbe685a50e65f9db25f682ad33105195efa8a
2020-02-26 00:43:23 +00:00
Treehugger Robot
a78d0cb735 Merge "First working version of the confirmationui HAL service" 2020-01-21 16:40:03 +00:00
Janis Danisevskis
8fe0cfb098 First working version of the confirmationui HAL service
This implementation does not provide any security guaranties.
 * The input method (NotSoSecureInput) runs a crypto protocols that is
   sufficiently secure IFF the end point is implemented on a trustworthy
   secure input device. But since the endpoint is currently in the HAL
   service itself this implementation is not secure.
 * This implementation provides most of the functionality, but not the
   secure UI infrastructure required to run Android Protected
   Confirmation.

Bug: 146078942
Test: VtsHalConfirmationUIV1_0TargetTest
Change-Id: I14717b5fa4ef15db960cdd506b8c6fe5369aec8d
2020-01-17 16:34:48 -08:00
Steven Moreland
e40e4270e8 remove deprecated bp 'subdirs'
noticed some, so thought I would remove them everywhere here

Bug: N/A
Test: N/A
Change-Id: I2978673b158d6c253914ea22f7f0129e446a5f91
2020-01-14 12:18:40 -08:00
Wenhao Wang
d363769dcf Merge "trusty:storageproxyd: Add ufs to parse_dev_type" 2020-01-04 00:10:57 +00:00
Wenhao Wang
3bf07c27de trusty:storageproxyd: Add ufs to parse_dev_type
Modify parse_dev_type function to accept new dev_type argument "ufs".

Bug: 143636526
Test: Trusty storage tests
Change-Id: I9524fd4cb9619b5ce1f4f46e87f1890f84f4d2f3
2020-01-03 13:47:57 -08:00