History log of /fuchsia/zircon/system/dev/tee/optee/optee-message.cpp
Revision Date Author Comments
# 8920abe1 19-Sep-2018 Christopher Tam <godtamit@google.com>

[optee][tee] Overhaul of OP-TEE messages

This CL makes the following changes to the message representation within
the OP-TEE driver:
* RpcMessage is a new class that replaces UnmanagedMessage and
features new safety checks on memory before parsing contents.
* Different RPC commands now subclass from RpcMessage and should
perform general parameter validation within these classes.[1]
* Replace ManagedMessage with a new Message type that has move-only
semantics to better represent intended ownership rules.
* New documentation :)

[1] To prevent the change from being XXL (for reviewers' sakes), just
the RPC command for loading trusted applications has been ported over to
using a subclass of RpcMessage for its message parameter parsing. The
remaining implemented RPC commands will be ported over in a subsequent
change.

Test: Just representation has been changed but behavior is preserved.
Confirmed on astro.

Change-Id: I0145fbbf5e983b3a699d5a10ae5c7540d45110c9


# 1bb67bbf 17-Aug-2018 Christopher Tam <godtamit@google.com>

[tee][optee] Implement basic RPC command handling

One of the core RPCs in the OP-TEE spec executes a command specified and
parameterized by an OP-TEE message format stored in memory. This CL
adds support for the commands that allocate/free shared memory and load
trusted applications for the trusted world. Supporting these commands
are enough to allow for simple trusted applications to be loaded and
executed in OP-TEE.

Test: Manual testing on both VIM2 and Astro to verify that the
TEEC_OpenSession API loads and returns successfully for a test "hello
world" trusted application-client application pair.

Change-Id: I1a2baa39c81090c678506e5b76abd792236835dd


# dbea6119 20-Aug-2018 Christopher Tam <godtamit@google.com>

[tee][optee] Support unmanaged/managed messages

Messages in OP-TEE can be created from multiple sources, with the two
main uses being REE -> TEE and TEE -> REE (usually RPC calls). As such,
the underlying SharedMemory of these Messages may have different
owners and lifetime requirements. This CL allows a Message to accept
both raw and smart pointers for the underlying memory.

Test: Manual testing on VIM2 that existing functionality based on
Messages are still functioning properly.

Change-Id: Ia3b459811ddb36f5e63b14955dfd7ee0929653e3


# aec5afba 25-Jul-2018 RJ Ascani <rjascani@google.com>

[tee][optee] Add open session interface

To communicate between a client app and trusted app pair, a session must
be created. This is done by sending an OP-TEE message to the secure
world requesting a new session be established. This CL adds an interface
to the OP-TEE device driver for opening a session and receiving a
session id back. That id is then stored in the implementation specific
portion of the TEE Client API's TEEC_Session.

In practice, this doesn't quite work yet. Upon receiving the session
request, OP-TEE replies with an RPC request for shared memory. Since we
haven't added RPC handling yet, we fail there.

Test: Run tee-test and see that it fails when RPC request is made by
secure world.

Change-Id: I56ff5f2a98b73c3d262738197b6bb62e2ef58fa5