Commit graph

25 commits

Author SHA1 Message Date
Arve Hjønnevåg
294ba38082 trusty: rpmb_dev: Use socket from init and update init script
Stop creating a socket on a persistent filesystem and use a socket
created by init in /dev/socket/ instead.

Many init script changes to make rpmb_dev.rc usable on cuttlefish.

Test: Build and run aosp_cf_x86_64_phone_trusty_vm-trunk_staging-userdebug
Bug: 309007107
Change-Id: Idc830211b3298d25bbb310dcb7489dd89fe5afc6
2024-03-19 20:02:34 +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
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
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
Snehal
6e074fc31e Add UUIDs to profraw filenames
Bug: 295866435

Change-Id: Ie9390f412c70202d1583e29ac83c30778ae02f70
2023-08-18 09:43:15 +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
Snehal
806e70bb94 Add Coverage controller
Bug: 289523068

Change-Id: I5b36c274acc7da4e2d6b9cf91409a7b1af5f0d34
2023-08-04 08:54:52 +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
Stephen Crane
54020821f6 trusty: Increase size of ACVP shared memory
The boringssl ACVP config has grown, so we need to increase the size of
our memory allocation that we share with the Trusty test TA.

Test: acvptool -wrapper trusty_acvp_modulewrapper -regcap
Bug: None
Change-Id: Ia90f4972d0d2ac420b09110f5647355a44175267
2022-08-22 19:43:54 -07: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
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
Bob Badour
576104304d [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  libstats/pull_lazy/Android.bp
  libstats/socket_lazy/Android.bp
  trusty/utils/acvp/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I33005150521238b61d1a8c923749b17d36bba693
2021-03-17 12:59:19 -07:00
Wenhao Wang
b0f77dfe3b Merge "Trusty: Add BoringSSL modulewrapper for ACVP" 2021-03-17 18:54:36 +00: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
Elliott Hughes
c3a206ccda Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"
This reverts commit 187b7d1950.

Reason for revert: system/core is multiple projects, not one.

Change-Id: I790ea41741f8cd9b8b6db2f59a49e71fb0958fd6
2021-02-16 20:01:20 +00:00
Bob Badour
187b7d1950 [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:
  Android.bp
  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/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: I5bd81adb5cdcf2b4dd4141b204eb430ff526af8f
2021-02-16 04:10:03 -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
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
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
Matthew Maurer
503ea0e231 Add support for mocked RPMB
When developing, it may be preferable to operate on a device which does
not have a real RPMB storage, or which is unprovisioned. This CL allows
the rpmb_dev program to act as a daemon serving a fixed key, and for
storageproxyd to speak to rpmb_dev's socket rather than an actual rpmb
device or a virtual rpmb device.

Test: Trusty Gatekeeper VTS
Change-Id: I19b2b143fffb8e68e4a028d00eaf5cd1928e12f6
2019-11-27 14:41:16 -08:00
Tri Vo
8b1e934555 trusty-ut-ctrl: link statically to libtrusty
Removes the need to push libtrusty.so to run trusty-ut-ctrl binary.

Test: m trusty-ut-ctrl
Change-Id: I19c2957d3eb1dc165e13f2ce5560fe31ea9a2469
2019-10-28 14:54:06 -07:00
Michael Ryleev
129fadf051 trusty: Add trusty unittest control utility
It is designed to connect to user specified port and
implements unittest logging protocol supported by
typical unittest ap running on Trusty side.

Test: manual
Change-Id: I6e37ccee9b9e4dde563ef0e4f531b42091cc2bd8
2019-01-04 11:54:26 -08:00