SlideShare a Scribd company logo
TEE to Run Trusted OS
on RISC-V and Related
Technologies
1
National Institute of Advanced Industrial Science and Technology(AIST)
Kuniyasu Suzaki, Akira Tsukamoto
Contents
• What is TEE?
– RISC-V TEE
• Trusted OS
– “OP-TEE”
– Requirement to implement OP-TEE
2
The difference from Micro51 workshop.
Software view (RISC-V day Tokyo), Hardware view (Micro51 workshop)
Slides will be opened at https://www.slideshare.net/suzaki
HIEE: Hardware-assisted Isolated Execution Environments*
• HIEE is used for important process which is independent of OS.
• Current CPU has HIEE.
– X86 SMM: System Management Mode
• Used by BIOS/UEFI.
– Intel’s ME: Management Engine.
• Run MINIX. Used for remote power control.
– Intel SGX: Software Guard execution
– ARM Trust Zone
3
* F.Zhang and H.Zhang, SoK:A Study of Using Hardware-assisted Isolated Execution
Environments for Security[HASP16]
They are not programmable for a user.
They are programmable for a user.
They are used for TEE.
What is TEE?
• TEE: Trusted Execution Environment.
– TEE separates computing world into “normal” and “secure”.
• Secure world is used to run a critical code (e.g., authentication, DRM, etc).
– GlobalPlatform defines TEE specification.
• https://globalplatform.org/technical-committees/trusted-execution-environment-tee-committee/
4
CPU
TEE
Secure World Normal World
App
Normal OS
Privileges for TEE
• Global Platform's TEE specification assumes plural privileges on both
worlds to run application on a OS.
– Normal world runs normal applications on a normal OS.
– Secure world runs trusted applications (TAs) on a trusted OS.
• ARM Trust Zone offers same privileges to normal and secure world.
• Intel SGX has only one privilege (enclave).
– Enclave is different from Ring Architecture.
5
CPU
Trusted OS
Secure World Normal World
App
Normal OS (e.g., Linux)
Trusted Application (TA)
POSIX APIGP TEE API
TEE projects on RISC-V
• Sanctum [MIT project, USENIX Sec’16]
• KeyStone [UCB project]
– https://keystone-enclave.org/
• MultiZone [Hex-Five product]
– https://hex-five.com/
• TEE WG of RISC-V Foundation
6
Intel SGX type
One special privilege (Enclave)
ARM Trust Zone type
plural privileges
easy to implement GlobalPlatform
style Trusted OS
ARM
Trusted OS on ARM Trust Zone
• GlobalPlatform model
7
Secure world Normal world
Normal Applications
Normal OS
NIC
Core
Trusted OS
Trusted Applications (TA)
Core
Secure
Mode
Hard
eMMCUART
Exception Level
EL0: User
EL1: Privilege
EL2: Hypervisor
EL3: Secure
SMC (Secure Monitor Call)
instruction
Memory
Static allocate
Dynamic allocate
Boot Sequence on ARM Trust Zone
• BL: Boot Loader
• EL: Exception Level
8
Power on
BL1:
BootROM
BL2:
Trusted Boot
Firmware
Secure World Normal World
BL31:
Secure
Monitor
BL32:
Trusted OS BL33:
Normal OS
EL3:Secure EL2:Hypervisor EL1:Priviledge EL0:User EL3:Secure EL2:Hypervisor EL1:Priviledge EL0:User
Trusted OS
• Trusted OS is not a normal OS
– Trusted OS is TCB (Trusted Computing Base). It must be secure
(small).
– No POSIX API, No dynamic link library
• TA becomes a static linked binary.
• Trusted OS needs the help of normal OS
– Because Trusted OS has no File System, no device driver (except
some special devices, e.g., UART)
• When a TA want to save a data, the data is encrypted and saved on FS of
normal OS.
9
Trusted OS
• Open Source Trusted OS
– OP-TEE (Linaro) https://github.com/OP-TEE
– Open-TEE (Aalto University[TrustCom15]) https://open-tee.github.io/
– Trusty (Google) https://source.android.com/security/trusty/index.html
– SierraTEE (Sierra) https://www.sierraware.com/open-source-ARM-TrustZone.html
• Enterprise Trusted OS
– Apple’s Secure Enclave
– Qualcomm’s QSEE
– Samsung’s Knox https://www.samsungknox.com/en
– Trastonic Kinibi and MobiCore
10
How to run a TA on OP-TEE
11
Secure World Normal World
Secure Monitor
Exception Level
EL0: User
EL1: Privilege
EL2: Hypervisor
EL3: Secure
Linux
with op-tee driver
TA
with
libutee.a
OP-TEE
(signature check)
(dispatch by UUID)
TA-Client TEE-Supplicant
/dev/tee0 /dev/teeprev0
Load a TA
Use a TA Helper of TAsignatureMajor Roll
• TA-Client loads a TA on OP-TEE
– TA needs a signature to load on OP-TEE
– TA has a UUID to communicate with TA-
Client and TEE-Supplicant
• TA-Client sends a request to TA
• TA replies an answer to TA-Client
• TA sends a request to TEE-
Supplicant (e.g., to save an
encrypted data on File System)
TEE internal API only (No POSIX sys call)
TA
libtee.so
Memory Map of OP-TEE
• ARM Hikey Board 2GB
• Software size: Our experience
– Secure world
• Secure Monitor 33KB
• OP-TEE 281KB
• TA 1,200KB
– Normal World (on Linux)
• TA-Client 17KB
• TEE-Supplicant 197KB
12
0x7FFFFFFF (2GB)
OP-TEE & TA
0x7F000000
16MB
0x7EC0000
Shared Memory 4 MB
0x7E80000
Linux Kernel
with SMC driver
4 MB
0x7E00000
8 MB
Secure Data
Path Buffer
Reserved
Secure
World
Normal
World
OP-TEE on RISC-V using seL4
• Rahul Mahadev’s Google Summer of Code
• http://mahadevrahul.blogspot.com/
– The Trust Zone features and secure monitor
are implemented as a seL4 library.
– OP-TEE is paravirtualized, all calls referencing
ARM Trusted Firmware and secure monitor are
replaced with new calls.
13
seL4
Rich OS
(Linux) Library to
emulate
Trust Zone
VMM
Paravirtualized OP-TEE
TAApp
Conclusions
• My talk is software view of TEE
• When we implement OP-TEE on RISC-V, we must develop
– Boot sequence: Trusted Boot Firmware, Secure Monitor
– Linux kernel driver
– Libraries (libutee.a for TA and libtee.so for Linux Apps)
– Linux application to assist TA (TEE-supplicant)
14
See Micro51 RISC-V workshop for hardware view
Slide of RISC-V Day Tokyo 2018 and Micro51 RISC-V workshop will be opened at
https://www.slideshare.net/suzaki

More Related Content

PDF
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Kuniyasu Suzaki
 
PDF
LCU14 500 ARM Trusted Firmware
Linaro
 
PDF
LCU13: An Introduction to ARM Trusted Firmware
Linaro
 
PDF
Trusted firmware deep_dive_v1.0_
Linaro
 
PDF
BKK16-110 A Gentle Introduction to Trusted Execution and OP-TEE
Linaro
 
PDF
SFO15-503: Secure storage in OP-TEE
Linaro
 
PDF
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Linaro
 
PDF
Xen in Safety-Critical Systems - Critical Summit 2022
Stefano Stabellini
 
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Kuniyasu Suzaki
 
LCU14 500 ARM Trusted Firmware
Linaro
 
LCU13: An Introduction to ARM Trusted Firmware
Linaro
 
Trusted firmware deep_dive_v1.0_
Linaro
 
BKK16-110 A Gentle Introduction to Trusted Execution and OP-TEE
Linaro
 
SFO15-503: Secure storage in OP-TEE
Linaro
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Linaro
 
Xen in Safety-Critical Systems - Critical Summit 2022
Stefano Stabellini
 

What's hot (20)

PDF
Rootlinux17: An introduction to Xen Project Virtualisation
The Linux Foundation
 
PDF
TEE - kernel support is now upstream. What this means for open source security
Linaro
 
PDF
LCU14-103: How to create and run Trusted Applications on OP-TEE
Linaro
 
PDF
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
The Linux Foundation
 
PDF
IPMI is dead, Long live Redfish
Bruno Cornec
 
PDF
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Stefano Stabellini
 
ODP
Introduction to Optee (26 may 2016)
Yannick Gicquel
 
PDF
The Internals of "Hello World" Program
National Cheng Kung University
 
PDF
Lcu14 107- op-tee on ar mv8
Linaro
 
PDF
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
Linaro
 
PDF
SFO15-200: Linux kernel generic TEE driver
Linaro
 
PDF
Xen Cache Coloring: Interference-Free Real-Time System
Stefano Stabellini
 
PDF
ELC21: VM-to-VM Communication Mechanisms for Embedded
Stefano Stabellini
 
PDF
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
Linaro
 
PDF
Embedded Virtualization applied in Mobile Devices
National Cheng Kung University
 
PDF
from Source to Binary: How GNU Toolchain Works
National Cheng Kung University
 
PDF
Scheduling in Android
Opersys inc.
 
PPTX
Understanding DPDK
Denys Haryachyy
 
PDF
HKG15-311: OP-TEE for Beginners and Porting Review
Linaro
 
PDF
DPDK: Multi Architecture High Performance Packet Processing
Michelle Holley
 
Rootlinux17: An introduction to Xen Project Virtualisation
The Linux Foundation
 
TEE - kernel support is now upstream. What this means for open source security
Linaro
 
LCU14-103: How to create and run Trusted Applications on OP-TEE
Linaro
 
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
The Linux Foundation
 
IPMI is dead, Long live Redfish
Bruno Cornec
 
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Stefano Stabellini
 
Introduction to Optee (26 may 2016)
Yannick Gicquel
 
The Internals of "Hello World" Program
National Cheng Kung University
 
Lcu14 107- op-tee on ar mv8
Linaro
 
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
Linaro
 
SFO15-200: Linux kernel generic TEE driver
Linaro
 
Xen Cache Coloring: Interference-Free Real-Time System
Stefano Stabellini
 
ELC21: VM-to-VM Communication Mechanisms for Embedded
Stefano Stabellini
 
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
Linaro
 
Embedded Virtualization applied in Mobile Devices
National Cheng Kung University
 
from Source to Binary: How GNU Toolchain Works
National Cheng Kung University
 
Scheduling in Android
Opersys inc.
 
Understanding DPDK
Denys Haryachyy
 
HKG15-311: OP-TEE for Beginners and Porting Review
Linaro
 
DPDK: Multi Architecture High Performance Packet Processing
Michelle Holley
 
Ad

Similar to RISC-V-Day-Tokyo2018-suzaki (20)

PDF
BKK16-110~---3892hnfi2r8ru94jofmcw8ujd.pdf
satyabratmallaBujarb
 
PDF
LCA14: LCA14-502: The way to a generic TrustZone® solution
Linaro
 
PDF
Securing the Internet of Things - Hank Chavers
WithTheBest
 
PDF
Lcu14 306 - OP-TEE Future Enhancements
Linaro
 
PDF
Labri 2021-invited-talk
vschiavoni
 
PDF
LAS16 111 - Raspberry pi3, op-tee and jtag debugging
96Boards
 
PDF
Standardizing the tee with global platform and RISC-V
RISC-V International
 
PDF
Secure initialization of Trusted Execution Environments: When Secure Boot fal...
Riscure
 
PDF
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls short
Cristofaro Mune
 
PPTX
Security for io t apr 29th mentor embedded hangout
mentoresd
 
PDF
Introduction of AArch64 TrustZone and OPTEE
Chiawei Wang
 
PPTX
Review of Hardware based solutions for trusted cloud computing.pptx
ssusere142fe
 
PDF
Attack your Trusted Core
Di Shen
 
PPTX
HiPEAC 2022_Marcelo Pasin presentation
VEDLIoT Project
 
PPT
Track f evolving trusted platforms - arm
chiportal
 
PDF
Implementing Trusted Endpoints in the Mobile World
LINE Corporation
 
PDF
Implementing a Security strategy in IoT, Practical example Automotive Grade L...
LibreCon
 
PDF
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
FFRI, Inc.
 
PDF
Sierraware ARM hypervisor
Sierraware
 
PDF
HKG18-212 - Trusted Firmware M: Introduction
Linaro
 
BKK16-110~---3892hnfi2r8ru94jofmcw8ujd.pdf
satyabratmallaBujarb
 
LCA14: LCA14-502: The way to a generic TrustZone® solution
Linaro
 
Securing the Internet of Things - Hank Chavers
WithTheBest
 
Lcu14 306 - OP-TEE Future Enhancements
Linaro
 
Labri 2021-invited-talk
vschiavoni
 
LAS16 111 - Raspberry pi3, op-tee and jtag debugging
96Boards
 
Standardizing the tee with global platform and RISC-V
RISC-V International
 
Secure initialization of Trusted Execution Environments: When Secure Boot fal...
Riscure
 
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls short
Cristofaro Mune
 
Security for io t apr 29th mentor embedded hangout
mentoresd
 
Introduction of AArch64 TrustZone and OPTEE
Chiawei Wang
 
Review of Hardware based solutions for trusted cloud computing.pptx
ssusere142fe
 
Attack your Trusted Core
Di Shen
 
HiPEAC 2022_Marcelo Pasin presentation
VEDLIoT Project
 
Track f evolving trusted platforms - arm
chiportal
 
Implementing Trusted Endpoints in the Mobile World
LINE Corporation
 
Implementing a Security strategy in IoT, Practical example Automotive Grade L...
LibreCon
 
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
FFRI, Inc.
 
Sierraware ARM hypervisor
Sierraware
 
HKG18-212 - Trusted Firmware M: Introduction
Linaro
 
Ad

More from Kuniyasu Suzaki (20)

PDF
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
Kuniyasu Suzaki
 
PDF
遠隔デバイスとの信頼を築くための技術とその標準(TEEP RATS)
Kuniyasu Suzaki
 
PDF
IETF111 RATS: Remote Attestation ProcedureS 報告
Kuniyasu Suzaki
 
PDF
Slide presented at FIT 2021 Top Conference (Reboot Oriented IoT, ACSAC2021)
Kuniyasu Suzaki
 
PDF
ACSAC2020 "Return-Oriented IoT" by Kuniyasu Suzaki
Kuniyasu Suzaki
 
PDF
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
Kuniyasu Suzaki
 
PDF
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
Kuniyasu Suzaki
 
PDF
BMC: Bare Metal Container @Open Source Summit Japan 2017
Kuniyasu Suzaki
 
PDF
USENIX NSDI17 Memory Disaggregation
Kuniyasu Suzaki
 
PDF
Io t security-suzki-20170224
Kuniyasu Suzaki
 
PDF
”Bare-Metal Container" presented at HPCC2016
Kuniyasu Suzaki
 
PDF
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
Kuniyasu Suzaki
 
PDF
Report for S4x14 (SCADA Security Scientific Symposium 2014)
Kuniyasu Suzaki
 
PDF
Slide used at ACM-SAC 2014 by Suzaki
Kuniyasu Suzaki
 
PDF
OSセキュリティチュートリアル
Kuniyasu Suzaki
 
PDF
Nested Virtual Machines and Proxies
Kuniyasu Suzaki
 
PDF
Bitvisorをベースとした既存Windowsのドライバメモリ保護
Kuniyasu Suzaki
 
PDF
Security on cloud storage and IaaS (NSC: Taiwan - JST: Japan workshop)
Kuniyasu Suzaki
 
PDF
仮想化技術によるマルウェア対策とその問題点
Kuniyasu Suzaki
 
PDF
Technology Used in Virtual Machine (Jan 2008)
Kuniyasu Suzaki
 
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
Kuniyasu Suzaki
 
遠隔デバイスとの信頼を築くための技術とその標準(TEEP RATS)
Kuniyasu Suzaki
 
IETF111 RATS: Remote Attestation ProcedureS 報告
Kuniyasu Suzaki
 
Slide presented at FIT 2021 Top Conference (Reboot Oriented IoT, ACSAC2021)
Kuniyasu Suzaki
 
ACSAC2020 "Return-Oriented IoT" by Kuniyasu Suzaki
Kuniyasu Suzaki
 
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
Kuniyasu Suzaki
 
3種類のTEE比較(Intel SGX, ARM TrustZone, RISC-V Keystone)
Kuniyasu Suzaki
 
BMC: Bare Metal Container @Open Source Summit Japan 2017
Kuniyasu Suzaki
 
USENIX NSDI17 Memory Disaggregation
Kuniyasu Suzaki
 
Io t security-suzki-20170224
Kuniyasu Suzaki
 
”Bare-Metal Container" presented at HPCC2016
Kuniyasu Suzaki
 
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
Kuniyasu Suzaki
 
Report for S4x14 (SCADA Security Scientific Symposium 2014)
Kuniyasu Suzaki
 
Slide used at ACM-SAC 2014 by Suzaki
Kuniyasu Suzaki
 
OSセキュリティチュートリアル
Kuniyasu Suzaki
 
Nested Virtual Machines and Proxies
Kuniyasu Suzaki
 
Bitvisorをベースとした既存Windowsのドライバメモリ保護
Kuniyasu Suzaki
 
Security on cloud storage and IaaS (NSC: Taiwan - JST: Japan workshop)
Kuniyasu Suzaki
 
仮想化技術によるマルウェア対策とその問題点
Kuniyasu Suzaki
 
Technology Used in Virtual Machine (Jan 2008)
Kuniyasu Suzaki
 

Recently uploaded (20)

PDF
Google’s NotebookLM Unveils Video Overviews
SOFTTECHHUB
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PPTX
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
AbdullahSani29
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
Google’s NotebookLM Unveils Video Overviews
SOFTTECHHUB
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
AbdullahSani29
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Software Development Methodologies in 2025
KodekX
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 

RISC-V-Day-Tokyo2018-suzaki

  • 1. TEE to Run Trusted OS on RISC-V and Related Technologies 1 National Institute of Advanced Industrial Science and Technology(AIST) Kuniyasu Suzaki, Akira Tsukamoto
  • 2. Contents • What is TEE? – RISC-V TEE • Trusted OS – “OP-TEE” – Requirement to implement OP-TEE 2 The difference from Micro51 workshop. Software view (RISC-V day Tokyo), Hardware view (Micro51 workshop) Slides will be opened at https://www.slideshare.net/suzaki
  • 3. HIEE: Hardware-assisted Isolated Execution Environments* • HIEE is used for important process which is independent of OS. • Current CPU has HIEE. – X86 SMM: System Management Mode • Used by BIOS/UEFI. – Intel’s ME: Management Engine. • Run MINIX. Used for remote power control. – Intel SGX: Software Guard execution – ARM Trust Zone 3 * F.Zhang and H.Zhang, SoK:A Study of Using Hardware-assisted Isolated Execution Environments for Security[HASP16] They are not programmable for a user. They are programmable for a user. They are used for TEE.
  • 4. What is TEE? • TEE: Trusted Execution Environment. – TEE separates computing world into “normal” and “secure”. • Secure world is used to run a critical code (e.g., authentication, DRM, etc). – GlobalPlatform defines TEE specification. • https://globalplatform.org/technical-committees/trusted-execution-environment-tee-committee/ 4 CPU TEE Secure World Normal World App Normal OS
  • 5. Privileges for TEE • Global Platform's TEE specification assumes plural privileges on both worlds to run application on a OS. – Normal world runs normal applications on a normal OS. – Secure world runs trusted applications (TAs) on a trusted OS. • ARM Trust Zone offers same privileges to normal and secure world. • Intel SGX has only one privilege (enclave). – Enclave is different from Ring Architecture. 5 CPU Trusted OS Secure World Normal World App Normal OS (e.g., Linux) Trusted Application (TA) POSIX APIGP TEE API
  • 6. TEE projects on RISC-V • Sanctum [MIT project, USENIX Sec’16] • KeyStone [UCB project] – https://keystone-enclave.org/ • MultiZone [Hex-Five product] – https://hex-five.com/ • TEE WG of RISC-V Foundation 6 Intel SGX type One special privilege (Enclave) ARM Trust Zone type plural privileges easy to implement GlobalPlatform style Trusted OS
  • 7. ARM Trusted OS on ARM Trust Zone • GlobalPlatform model 7 Secure world Normal world Normal Applications Normal OS NIC Core Trusted OS Trusted Applications (TA) Core Secure Mode Hard eMMCUART Exception Level EL0: User EL1: Privilege EL2: Hypervisor EL3: Secure SMC (Secure Monitor Call) instruction Memory Static allocate Dynamic allocate
  • 8. Boot Sequence on ARM Trust Zone • BL: Boot Loader • EL: Exception Level 8 Power on BL1: BootROM BL2: Trusted Boot Firmware Secure World Normal World BL31: Secure Monitor BL32: Trusted OS BL33: Normal OS EL3:Secure EL2:Hypervisor EL1:Priviledge EL0:User EL3:Secure EL2:Hypervisor EL1:Priviledge EL0:User
  • 9. Trusted OS • Trusted OS is not a normal OS – Trusted OS is TCB (Trusted Computing Base). It must be secure (small). – No POSIX API, No dynamic link library • TA becomes a static linked binary. • Trusted OS needs the help of normal OS – Because Trusted OS has no File System, no device driver (except some special devices, e.g., UART) • When a TA want to save a data, the data is encrypted and saved on FS of normal OS. 9
  • 10. Trusted OS • Open Source Trusted OS – OP-TEE (Linaro) https://github.com/OP-TEE – Open-TEE (Aalto University[TrustCom15]) https://open-tee.github.io/ – Trusty (Google) https://source.android.com/security/trusty/index.html – SierraTEE (Sierra) https://www.sierraware.com/open-source-ARM-TrustZone.html • Enterprise Trusted OS – Apple’s Secure Enclave – Qualcomm’s QSEE – Samsung’s Knox https://www.samsungknox.com/en – Trastonic Kinibi and MobiCore 10
  • 11. How to run a TA on OP-TEE 11 Secure World Normal World Secure Monitor Exception Level EL0: User EL1: Privilege EL2: Hypervisor EL3: Secure Linux with op-tee driver TA with libutee.a OP-TEE (signature check) (dispatch by UUID) TA-Client TEE-Supplicant /dev/tee0 /dev/teeprev0 Load a TA Use a TA Helper of TAsignatureMajor Roll • TA-Client loads a TA on OP-TEE – TA needs a signature to load on OP-TEE – TA has a UUID to communicate with TA- Client and TEE-Supplicant • TA-Client sends a request to TA • TA replies an answer to TA-Client • TA sends a request to TEE- Supplicant (e.g., to save an encrypted data on File System) TEE internal API only (No POSIX sys call) TA libtee.so
  • 12. Memory Map of OP-TEE • ARM Hikey Board 2GB • Software size: Our experience – Secure world • Secure Monitor 33KB • OP-TEE 281KB • TA 1,200KB – Normal World (on Linux) • TA-Client 17KB • TEE-Supplicant 197KB 12 0x7FFFFFFF (2GB) OP-TEE & TA 0x7F000000 16MB 0x7EC0000 Shared Memory 4 MB 0x7E80000 Linux Kernel with SMC driver 4 MB 0x7E00000 8 MB Secure Data Path Buffer Reserved Secure World Normal World
  • 13. OP-TEE on RISC-V using seL4 • Rahul Mahadev’s Google Summer of Code • http://mahadevrahul.blogspot.com/ – The Trust Zone features and secure monitor are implemented as a seL4 library. – OP-TEE is paravirtualized, all calls referencing ARM Trusted Firmware and secure monitor are replaced with new calls. 13 seL4 Rich OS (Linux) Library to emulate Trust Zone VMM Paravirtualized OP-TEE TAApp
  • 14. Conclusions • My talk is software view of TEE • When we implement OP-TEE on RISC-V, we must develop – Boot sequence: Trusted Boot Firmware, Secure Monitor – Linux kernel driver – Libraries (libutee.a for TA and libtee.so for Linux Apps) – Linux application to assist TA (TEE-supplicant) 14 See Micro51 RISC-V workshop for hardware view Slide of RISC-V Day Tokyo 2018 and Micro51 RISC-V workshop will be opened at https://www.slideshare.net/suzaki