This patch series introduces Trusted Execution Environment (TEE) driver
for AMD APU enabled systems. The TEE is a secure area of a processor which
ensures that sensitive data is stored, processed and protected in an
isolated and trusted environment. The AMD Secure Processor is a dedicated
processor which provides TEE to enable HW platform security. It offers
protection against software attacks generated in Rich Operating
System (Rich OS) such as Linux running on x86. The AMD-TEE Trusted OS
running on AMD Secure Processor allows loading and execution of security
sensitive applications called Trusted Applications (TAs). An example of
a TA would be a DRM (Digital Rights Management) TA written to enforce
content protection.
Linux already provides a tee subsystem, which is described in [1]. The tee
subsystem provides a generic TEE ioctl interface which can be used by user
space to talk to a TEE driver. AMD-TEE driver registers with tee subsystem
and implements tee function callbacks in an AMD platform specific manner.
The following TEE commands are recognized by AMD-TEE Trusted OS:
1. TEE_CMD_ID_LOAD_TA : Load Trusted Application (TA) binary into TEE
environment
2. TEE_CMD_ID_UNLOAD_TA : Unload TA binary from TEE environment
3. TEE_CMD_ID_OPEN_SESSION : Open session with loaded TA
4. TEE_CMD_ID_CLOSE_SESSION : Close session with loaded TA
5. TEE_CMD_ID_INVOKE_CMD : Invoke a command with loaded TA
6. TEE_CMD_ID_MAP_SHARED_MEM : Map shared memory
7. TEE_CMD_ID_UNMAP_SHARED_MEM : Unmap shared memory
Each command has its own payload format. The AMD-TEE driver creates a
command buffer payload for submission to AMD-TEE Trusted OS.
This patch series has a dependency on another patch set titled - Add TEE
interface support to AMD Secure Processor driver.
[1] https://www.kernel.org/doc/Documentation/tee.txt
Rijo Thomas (2):
tee: allow compilation of tee subsystem for AMD CPUs
tee: add AMD-TEE driver
drivers/tee/Kconfig | 4 +-
drivers/tee/Makefile | 1 +
drivers/tee/amdtee/Kconfig | 8 +
drivers/tee/amdtee/Makefile | 5 +
drivers/tee/amdtee/amdtee_if.h | 183 +++++++++++++
drivers/tee/amdtee/amdtee_private.h | 159 +++++++++++
drivers/tee/amdtee/call.c | 370 ++++++++++++++++++++++++++
drivers/tee/amdtee/core.c | 510 ++++++++++++++++++++++++++++++++++++
drivers/tee/amdtee/shm_pool.c | 130 +++++++++
include/uapi/linux/tee.h | 1 +
10 files changed, 1369 insertions(+), 2 deletions(-)
create mode 100644 drivers/tee/amdtee/Kconfig
create mode 100644 drivers/tee/amdtee/Makefile
create mode 100644 drivers/tee/amdtee/amdtee_if.h
create mode 100644 drivers/tee/amdtee/amdtee_private.h
create mode 100644 drivers/tee/amdtee/call.c
create mode 100644 drivers/tee/amdtee/core.c
create mode 100644 drivers/tee/amdtee/shm_pool.c
--
1.9.1
There are cases in a virtualized environment where a privileged guest
needs to communicate with OP-TEE OS without the presence of a hypervisor
(eg system recovery). As OP-TEE OS with virtualization support requires
all guests to be announced and requests to be tagged with vm id, the above
task would require reflashing OP-TEE OS with a build that disables
virtualization support.
The following patches introduce compatibilty between a natively running OS
(ie without a hypervisor) and OP-TEE OS configured with virtualization
support. This is achieved by the driver announcing itself to OP-TEE, and
tagging subsequent requests with a predetermined vm id.
For this change to be interoperable with virtualized environments, a
hypervisor has the following options:
1. Filter out the OPTEE_SMC_SEC_CAP_VIRTUALIZATION capability, so that
the driver is not aware of executing in a virtualized setup. In that
case, the driver will not announce itself or update the vm id parameter.
2. Gracefully handle the announcement of addition / removal of guests from
the driver (OPTEE_SMC_VM_CREATED / OPTEE_SMC_VM_DESTROYED), and overwrite
the vm id parameter as normal.
Enabling this option does not have an impact on OP-TEE OS configured
without virtualization support.
Please notice that this patch depends on 9733b072a12a from mainline Linux,
which is not available in Linaro's tree.
Michalis Pappas (2):
tee: optee: Add protocol definitions for virtualization
tee: optee: Allow native systems to interact with
virtualization-enabled OP-TEE
drivers/tee/optee/Kconfig | 23 +++++++++++++++
drivers/tee/optee/core.c | 43 ++++++++++++++++++++++++++++
drivers/tee/optee/optee_smc.h | 54 +++++++++++++++++++++++++++++++++++
3 files changed, 120 insertions(+)
--
2.17.1
Please mind our privacy notice<https://www.opensynergy.com/datenschutzerklaerung/privacy-notice-for-busine…> pursuant to Art. 13 GDPR. // Unsere Hinweise zum Datenschutz gem. Art. 13 DSGVO finden Sie hier.<https://www.opensynergy.com/de/datenschutzerklaerung/datenschutzhinweise-fu…>
Add support for TEE based trusted keys where TEE provides the functionality
to seal and unseal trusted keys using hardware unique key. Also, this is
an alternative in case platform doesn't possess a TPM device.
This series also adds some TEE features like:
Patch #1, #2 enables support for registered kernel shared memory with TEE.
Patch #3 enables support for private kernel login method required for
cases like trusted keys where we don't wan't user-space to directly access
TEE service to retrieve trusted key contents.
Rest of the patches from #4 to #7 adds support for TEE based trusted keys.
This patch-set has been tested with OP-TEE based pseudo TA which can be
found here [1].
[1] https://github.com/OP-TEE/optee_os/pull/3082
Changes in v3:
1. Update patch #2 to support registration of multiple kernel pages.
2. Incoporate dependency patch #4 in this patch-set:
https://patchwork.kernel.org/patch/11091435/
3. Rebased to latest tpmdd-master.
Changes in v2:
1. Add reviewed-by tags for patch #1 and #2.
2. Incorporate comments from Jens for patch #3.
3. Switch to use generic trusted keys framework.
Sumit Garg (7):
tee: optee: allow kernel pages to register as shm
tee: enable support to register kernel memory
tee: add private login method for kernel clients
KEYS: trusted: Add generic trusted keys framework
KEYS: trusted: Introduce TEE based Trusted Keys
doc: keys: Document usage of TEE based Trusted Keys
MAINTAINERS: Add entry for TEE based Trusted Keys
Documentation/security/keys/index.rst | 1 +
Documentation/security/keys/tee-trusted.rst | 93 ++++++++
MAINTAINERS | 9 +
drivers/tee/optee/call.c | 7 +
drivers/tee/tee_core.c | 6 +
drivers/tee/tee_shm.c | 26 ++-
include/keys/trusted-type.h | 48 ++++
include/keys/trusted_tee.h | 66 ++++++
include/keys/trusted_tpm.h | 15 --
include/linux/tee_drv.h | 1 +
include/uapi/linux/tee.h | 8 +
security/keys/Kconfig | 3 +
security/keys/trusted-keys/Makefile | 2 +
security/keys/trusted-keys/trusted_common.c | 346 ++++++++++++++++++++++++++++
security/keys/trusted-keys/trusted_tee.c | 282 +++++++++++++++++++++++
security/keys/trusted-keys/trusted_tpm1.c | 345 +++++----------------------
16 files changed, 954 insertions(+), 304 deletions(-)
create mode 100644 Documentation/security/keys/tee-trusted.rst
create mode 100644 include/keys/trusted_tee.h
create mode 100644 security/keys/trusted-keys/trusted_common.c
create mode 100644 security/keys/trusted-keys/trusted_tee.c
--
2.7.4