[若渴] Preliminary Study on Design and Exploitation of Trustzone

“Preliminary” Study on Design
and Exploitation of Trustzone
@若渴 2018.3.24
<ajblane0612@gmail.com>
AjMaChInE
Outline
• Design category of using trustzone
• TEE Exploitation
Isolation
Process Isolation -> Kernel Isolation-> Function Isolation
(symmetrically call – non-preemptive)
[0]
ARM TrustZone Technology
“It aims at enabling the creation of an execution environment,
for protecting the confidentiality and integrity of critical code,
allowing that code to be executed isolated from the main
operating system (OS).” [0]
EL3
EL1
EL0
Design Category of Using TrustZone
• Security services
• Virtualization
• Development frameworks
Security Services
• DroidVault [1]
• TrustOTP [2]
• TZ-RKP [3]
DroidVault - Allowing the Secure
Management of Storage [1]
R0,R1
R2,R3
TrustOTP - Information Leakage of OTP
[2]
Why to Use Reliable Switch [2]
• SMC instruction
– When REE (Normal) Kernels are compromised
• Secure Interrupt
– Non-maskable GPIO-2 Secure Interrupt
Reliable Switch - Non-Maskable
Interrupt (NMI) Mechanism [2]
• Non-maskable GPIO-2 Secure Interrupt
Central Security Unit (CSU)
TZ-RKP: Avoid Bypassing the Memory
Protection using Double Mapping [3]
TZ-RKP: Control Instruction Emulation
and Trapping Translation Table Updates
Trsut-RKP OS Virtaul Memory Layout [3]
Virtualization
vTZ: When TEE OS is Compromised [4]
(c) is an Excellent Design [4]
Development Frameworks [0]
TrusrFrame [0]
GlobalPlatform API
ARM Trustzone API GlobalPlatform API
ARM Trustzone ARM Trustzone Intel SGX
E.G. OP-TEE
E.G. TrustFrame [0]
(ioctl)
Exploitation
• Semantic gap (BOOMERANG) [5]
• Revoke vulnerable trustlets [6]
Semantic Gap
• [利用特性]
– the secure world always maintains complete control
over and visibility into the non-secure world (similar
to a hypervisor and its guests)
– Visibility: the secure world and its associated TAs
have the ability to read and write to non-secure world
memory
• BOOMERANG (自食其果~”~) exploits the
semantic gap inherent to the design of all the
current TEE implementations.
BOOMERANG – PTR as DATA cannot
be Checked [5]
Revocation
• QSEE revocation
– The Attestation certificate preventing “rolling back”
to older versions of the software image
– 但 all trustlets share the same image identifier
• Kinibi revocation
– Reverse-engineer the bootloader binary including TEE
kernel
– 沒有DOC ->找到TEE kernel->又找到parsing
signature->解出the structure of the signature
– 但直接送有問題的tasklet就可@@a
[6]
Reference
• [0] 2016, Joao Rocheteau Ramos, TrustFrame, a Software
Development Framework for TrustZone-enabled Hardware
• [1] 2014, Xiaolei Li, DroidVault- A Trusted Data Vault for Android
• [2] 2015, He Sun, etc., TrustOTP- Transforming Smartphones into
Secure One-Time Password Tokens
• [3] 2014, Ahmed M Azab, etc. Hypervision Across Worlds : Real-
time Kernel Protection from the ARM TrustZone Secure World
• [4] 2017, Zhichao Hua, etc. vTZ- Virtualizing ARM TrustZone
• [5] 2017, Nick Stephens, etc. Boomerang- Exploiting the Semantic
Gap in Trusted Execution Environments
• [6] 2017, Gal Beniamini, Trust Issues-Exploiting TrustZone TEEs
1 of 25

More Related Content

Similar to [若渴] Preliminary Study on Design and Exploitation of Trustzone(20)

Oracle super cluster m7Oracle super cluster m7
Oracle super cluster m7
OTN Systems Hub1.9K views
Secure nets-and-dataSecure nets-and-data
Secure nets-and-data
Kevin Mayo497 views
Cont0519Cont0519
Cont0519
Samuel Dratwa310 views
Clonetab flyerClonetab flyer
Clonetab flyer
Venkata Meka179 views

Recently uploaded(20)

Industry4wrd.pptxIndustry4wrd.pptx
Industry4wrd.pptx
BC Chew153 views
GSoC 2024GSoC 2024
GSoC 2024
DeveloperStudentClub1049 views
Nico Baumbach IMR Media ComponentNico Baumbach IMR Media Component
Nico Baumbach IMR Media Component
InMediaRes1186 views
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar56 views
Psychology KS5Psychology KS5
Psychology KS5
WestHatch53 views
ICS3211_lecture 08_2023.pdfICS3211_lecture 08_2023.pdf
ICS3211_lecture 08_2023.pdf
Vanessa Camilleri68 views
Sociology KS5Sociology KS5
Sociology KS5
WestHatch50 views
231112 (WR) v1  ChatGPT OEB 2023.pdf231112 (WR) v1  ChatGPT OEB 2023.pdf
231112 (WR) v1 ChatGPT OEB 2023.pdf
WilfredRubens.com100 views
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
Svetlin Nakov57 views
Streaming Quiz 2023.pdfStreaming Quiz 2023.pdf
Streaming Quiz 2023.pdf
Quiz Club NITW87 views
Chemistry of sex hormones.pptxChemistry of sex hormones.pptx
Chemistry of sex hormones.pptx
RAJ K. MAURYA97 views
Scope of Biochemistry.pptxScope of Biochemistry.pptx
Scope of Biochemistry.pptx
shoba shoba110 views
Universe revised.pdfUniverse revised.pdf
Universe revised.pdf
DrHafizKosar84 views
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 Breakdown
WestHatch52 views

[若渴] Preliminary Study on Design and Exploitation of Trustzone

  • 1. “Preliminary” Study on Design and Exploitation of Trustzone @若渴 2018.3.24 <ajblane0612@gmail.com> AjMaChInE
  • 2. Outline • Design category of using trustzone • TEE Exploitation
  • 3. Isolation Process Isolation -> Kernel Isolation-> Function Isolation (symmetrically call – non-preemptive) [0]
  • 4. ARM TrustZone Technology “It aims at enabling the creation of an execution environment, for protecting the confidentiality and integrity of critical code, allowing that code to be executed isolated from the main operating system (OS).” [0] EL3 EL1 EL0
  • 5. Design Category of Using TrustZone • Security services • Virtualization • Development frameworks
  • 6. Security Services • DroidVault [1] • TrustOTP [2] • TZ-RKP [3]
  • 7. DroidVault - Allowing the Secure Management of Storage [1] R0,R1 R2,R3
  • 8. TrustOTP - Information Leakage of OTP [2]
  • 9. Why to Use Reliable Switch [2] • SMC instruction – When REE (Normal) Kernels are compromised • Secure Interrupt – Non-maskable GPIO-2 Secure Interrupt
  • 10. Reliable Switch - Non-Maskable Interrupt (NMI) Mechanism [2] • Non-maskable GPIO-2 Secure Interrupt Central Security Unit (CSU)
  • 11. TZ-RKP: Avoid Bypassing the Memory Protection using Double Mapping [3]
  • 12. TZ-RKP: Control Instruction Emulation and Trapping Translation Table Updates
  • 13. Trsut-RKP OS Virtaul Memory Layout [3]
  • 15. vTZ: When TEE OS is Compromised [4]
  • 16. (c) is an Excellent Design [4]
  • 18. GlobalPlatform API ARM Trustzone API GlobalPlatform API ARM Trustzone ARM Trustzone Intel SGX
  • 21. Exploitation • Semantic gap (BOOMERANG) [5] • Revoke vulnerable trustlets [6]
  • 22. Semantic Gap • [利用特性] – the secure world always maintains complete control over and visibility into the non-secure world (similar to a hypervisor and its guests) – Visibility: the secure world and its associated TAs have the ability to read and write to non-secure world memory • BOOMERANG (自食其果~”~) exploits the semantic gap inherent to the design of all the current TEE implementations.
  • 23. BOOMERANG – PTR as DATA cannot be Checked [5]
  • 24. Revocation • QSEE revocation – The Attestation certificate preventing “rolling back” to older versions of the software image – 但 all trustlets share the same image identifier • Kinibi revocation – Reverse-engineer the bootloader binary including TEE kernel – 沒有DOC ->找到TEE kernel->又找到parsing signature->解出the structure of the signature – 但直接送有問題的tasklet就可@@a [6]
  • 25. Reference • [0] 2016, Joao Rocheteau Ramos, TrustFrame, a Software Development Framework for TrustZone-enabled Hardware • [1] 2014, Xiaolei Li, DroidVault- A Trusted Data Vault for Android • [2] 2015, He Sun, etc., TrustOTP- Transforming Smartphones into Secure One-Time Password Tokens • [3] 2014, Ahmed M Azab, etc. Hypervision Across Worlds : Real- time Kernel Protection from the ARM TrustZone Secure World • [4] 2017, Zhichao Hua, etc. vTZ- Virtualizing ARM TrustZone • [5] 2017, Nick Stephens, etc. Boomerang- Exploiting the Semantic Gap in Trusted Execution Environments • [6] 2017, Gal Beniamini, Trust Issues-Exploiting TrustZone TEEs