SlideShare uma empresa Scribd logo
1 de 50
Baixar para ler offline
Cristofaro Mune (@pulsoid)
Eloi Sanfelix (@esanfelix)
when secure boot falls short…
Secure Initialization of TEEs
EuskalHack 2017
• Cristofaro Mune
− Embedded Security Consultant (Independent)
− Keywords: TEEs, IoT, Embedded SW & HW, Fault Injection
− Previous work: WBC, IoT, Embedded Exploitation, Mobile
• Eloi Sanfelix
− Principal Security Analyst @Riscure
− Keywords: Software security, TEE, RE, Exploiting, SCA/FI, CTF
− Previous work: WBC, DRM, PayTV, Smart Cards
Who?
• TEEs Increasingly relevant in security solutions
…Basically everywhere
• Research:
• Interesting but limited in amount and scope
• Lack of a generic TEE security modeling
• Components and Mechanisms
• Attack surfaces
• Attack vectors
What and why…
TEEs: Fundamentals
• Aimed at providing a secure environment for execution of
security critical tasks:
− Payment applications
− DRM applications
− …
• Separated from Rich execution environment (REE)
− Non-secure, untrusted environment
• Support for Trusted Application (TAs):
− Separated from each other
− Typically implementing one single use case
Trusted Execution Environment (TEE)
System overview
1
2
3
source: globalplatform.org
1. TEE separations:
1. Separation from the Rich Execution Environment (REE)
2. Separation between TAs and the TEE OS
3. Separation between TAs
TEE Critical items
Strong cooperation between HW & SW
We focus on this…
…but concepts also apply to these.
HW & SW roles
Hardware protecting
Software
Software protecting
secrets
A TEE reference frame (runtime)
H/W Platform
TEE OS
Drivers
SDK
TA
System TAs
1
2
3
4
6
5
REE TEE
Execution Memory I/O Inter-process
(MMU)
HW
primitives
for
separations
TEE Trusted Code Base
(TCB):
Can remove any protection
ARM TrustZone
Example SoC: CPU
CPU Security State
NS=1 NS=0
Security State propagation
ARM TZ
core
AMBA AXI3 bus
DDR Flash GPU...
AxPROT[1] indicates if transaction
Secure or Non-Secure
• All AXI slaves are memory mapped
− Including DDR, HW registers, etc.
− Page Table Entries include an NS-bit
• AxPROT[1] depends on CPU and PTE NS bits
How is AxPROT[1] determined?
CPU NS PTE NS AxPROT[1]
0 0 0
0 1 1
1 x 1
Example SoC: protection enforcement
Example: Protecting DDR memory
Example: Protecting peripherals
• AXI slaves in charge of enforcing transaction security
• Can be done with:
− Controllers (TZASC, TZPC, etc)
− Hardcoded logic in bus matrix
• Controllers MUST be configured by SW
What about other slaves?
Secure Boot
Why Secure Boot?
− Integrity and confidentiality of flash contents not assured
• TEE security is not established!
− Secure Boot provides this assurance
CPU
FLASH DDR
ROM OTP
Debug
BL1.2
…
BL1.1
SRAM
BL1.1
STACK
BL1.2
…
Generic Embedded System
Typical Secure Boot implementation
Internal ROM
Bootloader 1 (BL1)
RSA key
signature
…
− Assures integrity (and confidentiality) of flash contents
− Root of trust composed of immutable code and data
SB vulnerability: Samsung Galaxy S4
1. aboot copies header, then kernel
2. Signature is verified and kernel booted if OK.
CPU
FLASH DDR
ROM OTP
Debug
Generic Embedded System
Header
…
aboot
SRAM
aboot
STACK
Header
…
Source: Azimuth Security, Exploiting Samsung Galaxy S4 Secure Boot
Kernel
Kernel
Any problems?
Untrusted  Arbitrary memory corruption
Source: Azimuth Security, Exploiting Samsung Galaxy S4 Secure Boot
So what?
− aboot smashes its own code with attacker-supplied code!
− Alternatively, attacker could target return address on stack
Source: Azimuth Security, Exploiting Samsung Galaxy S4 Secure Boot
CPU
FLASH DDR
ROM OTP
Debug
Header
…
aboot
SRAM
aboot
STACK
Header
Kernel
Kernel
Generic Embedded System
SB vulnerability: AMLogic S905 SoC
Source: http://www.fredericb.info/2016/10/amlogic-s905-soc-bypassing-not-so.html
Untrusted data used to determine
whether signature check is enabled!
• Secure Boot makes sure code is authentic
− You still need to set up the REE and TEE!
• In particular:
− Initialize separations (TZASC, TZPC, … )
− Load TEE OS into Secure World
− Initialize other SoC components
Beyond Secure Boot
The TEE needs to be
securely initialized before
running any REE code!
“Time”:
TEE initialization
• TEE initialization is based on Secure Boot.
• TEE initialization must also protect, load, verify, initialize
and configure the TEE.
• Then demote to REE.
TEE initialization
A TEE reference frame (full)
H/W Platform
Root of
Trust
Boot stages
TEE OS
Drivers
SDK
TA
System TAs
1
2
3
4
6
5
7
8
REE TEE
Execution Memory I/O Inter-process
(MMU)
HW
primitives
for
separations
TEE Trusted Code Base
(TCB):
Can remove any protection
• Demotion point:
− The point (in time & code) in a boot process, where ALL the
privileges for configuring a TEE are given up
− …and REE is started.
• Critical path(s):
− The set of all the code paths that can be executed before the
Demotion point
− Parts of the TEE attack surface
Some definitions
How it works: Old Samsung phone
iROM
BL1
BL2
PBL
TZSW
Signed/encrypted
Signed
Signed
Android
SECKEYRestricted
External
Load + Exec
Exec
Load
Signed
REE execution
Critical paths
Demotion to REE
• The following must be executed before Demotion point
• For each TEE-related boot stage:
− Identify WHERE to load the stage in memory
− Protect memory from REE
- E.G. configure TZASC
− Load and Verify.
− Run any stage initialization code
• Configure (…more to come…)
− Other IPs
− Other Protection Controllers
Just “Secure Boot”?
• Reference implementation for trusted TEE initialization
− ARMv8-A architecture
− ATF v1.3 now released
- Security improvements over v1.2
• Customizations needed:
− Highly dependent on memory layout (and design)
− Examples:
- Configuration of TZASC and TZPC
 …or equivalent controllers
- Initialization routines for BL31 and BL32
ARM Trusted Firmware
Example: ARM Trusted Firmware
• One of TEE security foundations
− Is it Secure or Non-Secure Memory?
Range checks
How difficult can it be?
• TEE ranges can be dynamic (and scattered)
− Hardcoded values may be difficult to handle
• Logical mistakes may happen….
Real world example
https://atredispartners.blogspot.com.mt/2014/08/here-be-dragons-vulnerabilities-in.html
• Multiple memories:
− Not everything is DDR
• Layout can be dynamic:
− Example: Video Memory
• Proper check location and API design are fundamental
• System-level consistency of view is needed for proper
enforcement:
− Across every SW runtime component
− Across the whole SoC HW.
Range checks not so easy…
“Space” dimension:
Not just the ARM CPU
Remember?
• SoC much more than the ARM CPU
• DMA engines
− Crypto accelerators
− PCI/PCIe devices
• Other processing engines
− Audio/Video CPUs
− Modem and WiFi controllers
− Power management MCUs
Potential attack surface
Any IP with access to the bus MUST
be considered!
• Most masters are also slaves
− DMA transactions configured through the bus
− Auxiliary CPUs expose APIs through the bus
− …
• Need to take care of configuration
− Secure bus masters should not be driven by non-secure
processing engines
− Firmware running on secure bus masters should be
authenticated and secured!
Buses, masters and slaves
Example: HW crypto engine
DDR
REE Apps
Secure
DDR
REE
Code/Data
HW AES
Engine
Encrypted
content
TEE
Code/Data
Decrypted
content
REE OS
TAs
TEE OS
“Decrypt
from A to B”
SecureNon-secure
What if… ?
DDR
REE Apps
Secure
DDR
REE
Code/Data
HW AES
Engine
Encrypted
content
TEE
Code/Data
REE OS
TAs
TEE OS
“Decrypt
from A to B”
SecureNon-secure
• Some use cases might require isolating peripherals
− Secure display to show mobile payment data
− Secure touch sensor for PIN entry
− Secure fingerprint sensor
• But some peripherals need to be available to both worlds
 Runtime configuration required
Securing peripherals
State transitions must be carefully
considered
“Time and Space”:
TEE Warm Boot
• Simply put: Boot after “Suspend-To-RAM”
− Typically requested from REE
• Only some parts of the SoC are powered down:
− DDR in self-refresh mode
− Some limited parts always-on for restore
• Restore/reuse saved execution contexts
− E.g: Entry points
Warm Boot
• Contexts are not fully stored in TEE memory?
• Protection controllers are shutdown as well?
• Contexts are stored in non-DDR memory?
− E.G. some on-chip SRAM
• Remaining execution cores are non-secure?
− Do they have access to memory storing contexts?
What if…
Conclusion
• TEE security can be complex:
− Full HW & SW cooperation continuously required
• TEE initialization is critical
• HW can also be an attacker…
• More accurate TEE security model needed:
− Properly frame attacks, discussions and design choices
• Holistic view required
Conclusion
TEE is an environment…
…not “just” a feature.
Thank you!!
Cristofaro Mune (@pulsoid)
pulsoid@icysilence.org
Eloi Sanfelix (@esanfelix)
eloi@riscure.com

Mais conteúdo relacionado

Mais procurados

Efficient Reverse Engineering of Automotive Firmware
Efficient Reverse Engineering of Automotive FirmwareEfficient Reverse Engineering of Automotive Firmware
Efficient Reverse Engineering of Automotive FirmwareRiscure
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsenSilo
 
Property-Based TPM Virtualization
Property-Based TPM VirtualizationProperty-Based TPM Virtualization
Property-Based TPM VirtualizationMarcel Winandy
 
[Wroclaw #3] Trusted Computing
[Wroclaw #3] Trusted Computing[Wroclaw #3] Trusted Computing
[Wroclaw #3] Trusted ComputingOWASP
 
Embedded System Practical Workshop using the ARM Processor
Embedded System Practical Workshop using the ARM ProcessorEmbedded System Practical Workshop using the ARM Processor
Embedded System Practical Workshop using the ARM ProcessorMomenMostafa
 
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
TrustZone use case and trend (FFRI Monthly Research Mar 2017) TrustZone use case and trend (FFRI Monthly Research Mar 2017)
TrustZone use case and trend (FFRI Monthly Research Mar 2017) FFRI, Inc.
 
IBM i Encryption Made Easy
IBM i Encryption Made EasyIBM i Encryption Made Easy
IBM i Encryption Made EasyPrecisely
 
Digital Rights Management and Trusted Computing Base
Digital Rights Management and Trusted Computing BaseDigital Rights Management and Trusted Computing Base
Digital Rights Management and Trusted Computing BaseSajid Marwat
 
Resilient IoT Security: The end of flat security models
Resilient IoT Security: The end of flat security modelsResilient IoT Security: The end of flat security models
Resilient IoT Security: The end of flat security modelsMilosch Meriac
 
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...Kuniyasu Suzaki
 
Defcon 22-phil-polstra-cyber-hijacking-airplanes-truth-or-fi
Defcon 22-phil-polstra-cyber-hijacking-airplanes-truth-or-fiDefcon 22-phil-polstra-cyber-hijacking-airplanes-truth-or-fi
Defcon 22-phil-polstra-cyber-hijacking-airplanes-truth-or-fiPriyanka Aash
 
ATM Compromise with and without Whitelisting
ATM Compromise with and without WhitelistingATM Compromise with and without Whitelisting
ATM Compromise with and without WhitelistingAlexandru Gherman
 
Controlling PC on ARM using Fault Injection
Controlling PC on ARM using Fault InjectionControlling PC on ARM using Fault Injection
Controlling PC on ARM using Fault InjectionRiscure
 
The structure is fundamental: IP PBX, telephony cards and tools for high avai...
The structure is fundamental: IP PBX, telephony cards and tools for high avai...The structure is fundamental: IP PBX, telephony cards and tools for high avai...
The structure is fundamental: IP PBX, telephony cards and tools for high avai...PaloSanto Solutions
 
IBM i Encryption Made Easy
IBM i Encryption Made EasyIBM i Encryption Made Easy
IBM i Encryption Made EasyPrecisely
 
[CB19] Hardware Wallet Security
[CB19] Hardware Wallet Security[CB19] Hardware Wallet Security
[CB19] Hardware Wallet SecurityCODE BLUE
 
Leave ATM Forever Alone
Leave ATM Forever AloneLeave ATM Forever Alone
Leave ATM Forever AloneOlga Kochetova
 
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...CODE BLUE
 
Revisiting atm vulnerabilities for our fun and vendor’s
Revisiting atm vulnerabilities for our fun and vendor’sRevisiting atm vulnerabilities for our fun and vendor’s
Revisiting atm vulnerabilities for our fun and vendor’sOlga Kochetova
 

Mais procurados (20)

Efficient Reverse Engineering of Automotive Firmware
Efficient Reverse Engineering of Automotive FirmwareEfficient Reverse Engineering of Automotive Firmware
Efficient Reverse Engineering of Automotive Firmware
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
 
Property-Based TPM Virtualization
Property-Based TPM VirtualizationProperty-Based TPM Virtualization
Property-Based TPM Virtualization
 
[Wroclaw #3] Trusted Computing
[Wroclaw #3] Trusted Computing[Wroclaw #3] Trusted Computing
[Wroclaw #3] Trusted Computing
 
Embedded System Practical Workshop using the ARM Processor
Embedded System Practical Workshop using the ARM ProcessorEmbedded System Practical Workshop using the ARM Processor
Embedded System Practical Workshop using the ARM Processor
 
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
TrustZone use case and trend (FFRI Monthly Research Mar 2017) TrustZone use case and trend (FFRI Monthly Research Mar 2017)
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
 
IBM i Encryption Made Easy
IBM i Encryption Made EasyIBM i Encryption Made Easy
IBM i Encryption Made Easy
 
Digital Rights Management and Trusted Computing Base
Digital Rights Management and Trusted Computing BaseDigital Rights Management and Trusted Computing Base
Digital Rights Management and Trusted Computing Base
 
Resilient IoT Security: The end of flat security models
Resilient IoT Security: The end of flat security modelsResilient IoT Security: The end of flat security models
Resilient IoT Security: The end of flat security models
 
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
Kernel Memory Protection by an Insertable Hypervisor which has VM Introspec...
 
Defcon 22-phil-polstra-cyber-hijacking-airplanes-truth-or-fi
Defcon 22-phil-polstra-cyber-hijacking-airplanes-truth-or-fiDefcon 22-phil-polstra-cyber-hijacking-airplanes-truth-or-fi
Defcon 22-phil-polstra-cyber-hijacking-airplanes-truth-or-fi
 
ATM Compromise with and without Whitelisting
ATM Compromise with and without WhitelistingATM Compromise with and without Whitelisting
ATM Compromise with and without Whitelisting
 
Controlling PC on ARM using Fault Injection
Controlling PC on ARM using Fault InjectionControlling PC on ARM using Fault Injection
Controlling PC on ARM using Fault Injection
 
The structure is fundamental: IP PBX, telephony cards and tools for high avai...
The structure is fundamental: IP PBX, telephony cards and tools for high avai...The structure is fundamental: IP PBX, telephony cards and tools for high avai...
The structure is fundamental: IP PBX, telephony cards and tools for high avai...
 
IBM i Encryption Made Easy
IBM i Encryption Made EasyIBM i Encryption Made Easy
IBM i Encryption Made Easy
 
[CB19] Hardware Wallet Security
[CB19] Hardware Wallet Security[CB19] Hardware Wallet Security
[CB19] Hardware Wallet Security
 
Leave ATM Forever Alone
Leave ATM Forever AloneLeave ATM Forever Alone
Leave ATM Forever Alone
 
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
 
Intel update
Intel updateIntel update
Intel update
 
Revisiting atm vulnerabilities for our fun and vendor’s
Revisiting atm vulnerabilities for our fun and vendor’sRevisiting atm vulnerabilities for our fun and vendor’s
Revisiting atm vulnerabilities for our fun and vendor’s
 

Semelhante a Secure initialization of Trusted Execution Environments: When Secure Boot falls short

BKK16-110 A Gentle Introduction to Trusted Execution and OP-TEE
BKK16-110 A Gentle Introduction to Trusted Execution and OP-TEEBKK16-110 A Gentle Introduction to Trusted Execution and OP-TEE
BKK16-110 A Gentle Introduction to Trusted Execution and OP-TEELinaro
 
Security Consideration for Set-top box SoC
Security Consideration for Set-top box SoCSecurity Consideration for Set-top box SoC
Security Consideration for Set-top box SoCWesley Li
 
Breaking hardware enforced security with hypervisors
Breaking hardware enforced security with hypervisorsBreaking hardware enforced security with hypervisors
Breaking hardware enforced security with hypervisorsPriyanka Aash
 
6 andrii grygoriev - security issues in arm trust zone software
6   andrii grygoriev - security issues in arm trust zone software6   andrii grygoriev - security issues in arm trust zone software
6 andrii grygoriev - security issues in arm trust zone softwareIevgenii Katsan
 
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3Linaro
 
LAS16 111 - Raspberry pi3, op-tee and jtag debugging
LAS16 111 - Raspberry pi3, op-tee and jtag debuggingLAS16 111 - Raspberry pi3, op-tee and jtag debugging
LAS16 111 - Raspberry pi3, op-tee and jtag debugging96Boards
 
Gal Diskin - Virtually Impossible
Gal Diskin - Virtually Impossible Gal Diskin - Virtually Impossible
Gal Diskin - Virtually Impossible DefconRussia
 
RISC-V-Day-Tokyo2018-suzaki
RISC-V-Day-Tokyo2018-suzakiRISC-V-Day-Tokyo2018-suzaki
RISC-V-Day-Tokyo2018-suzakiKuniyasu Suzaki
 
LCA14: LCA14-502: The way to a generic TrustZone® solution
LCA14: LCA14-502: The way to a generic TrustZone® solutionLCA14: LCA14-502: The way to a generic TrustZone® solution
LCA14: LCA14-502: The way to a generic TrustZone® solutionLinaro
 
Implementing Trusted Endpoints in the Mobile World
Implementing Trusted Endpoints in the Mobile WorldImplementing Trusted Endpoints in the Mobile World
Implementing Trusted Endpoints in the Mobile WorldLINE Corporation
 
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...Kuniyasu Suzaki
 
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...Cristofaro Mune
 
Top 10 secure boot mistakes
Top 10 secure boot mistakesTop 10 secure boot mistakes
Top 10 secure boot mistakesJustin Black
 
Solnik secure enclaveprocessor-pacsec
Solnik secure enclaveprocessor-pacsecSolnik secure enclaveprocessor-pacsec
Solnik secure enclaveprocessor-pacsecPacSecJP
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootLinaro
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4Qualcomm Developer Network
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsThe Linux Foundation
 
Secure IOT Gateway
Secure IOT GatewaySecure IOT Gateway
Secure IOT GatewayLF Events
 
Software Attacks on Hardware Wallets
Software Attacks on Hardware WalletsSoftware Attacks on Hardware Wallets
Software Attacks on Hardware WalletsRiscure
 
FIPS 140-2 Validations in a Secure Enclave
FIPS 140-2 Validations in a Secure EnclaveFIPS 140-2 Validations in a Secure Enclave
FIPS 140-2 Validations in a Secure EnclavewolfSSL
 

Semelhante a Secure initialization of Trusted Execution Environments: When Secure Boot falls short (20)

BKK16-110 A Gentle Introduction to Trusted Execution and OP-TEE
BKK16-110 A Gentle Introduction to Trusted Execution and OP-TEEBKK16-110 A Gentle Introduction to Trusted Execution and OP-TEE
BKK16-110 A Gentle Introduction to Trusted Execution and OP-TEE
 
Security Consideration for Set-top box SoC
Security Consideration for Set-top box SoCSecurity Consideration for Set-top box SoC
Security Consideration for Set-top box SoC
 
Breaking hardware enforced security with hypervisors
Breaking hardware enforced security with hypervisorsBreaking hardware enforced security with hypervisors
Breaking hardware enforced security with hypervisors
 
6 andrii grygoriev - security issues in arm trust zone software
6   andrii grygoriev - security issues in arm trust zone software6   andrii grygoriev - security issues in arm trust zone software
6 andrii grygoriev - security issues in arm trust zone software
 
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
 
LAS16 111 - Raspberry pi3, op-tee and jtag debugging
LAS16 111 - Raspberry pi3, op-tee and jtag debuggingLAS16 111 - Raspberry pi3, op-tee and jtag debugging
LAS16 111 - Raspberry pi3, op-tee and jtag debugging
 
Gal Diskin - Virtually Impossible
Gal Diskin - Virtually Impossible Gal Diskin - Virtually Impossible
Gal Diskin - Virtually Impossible
 
RISC-V-Day-Tokyo2018-suzaki
RISC-V-Day-Tokyo2018-suzakiRISC-V-Day-Tokyo2018-suzaki
RISC-V-Day-Tokyo2018-suzaki
 
LCA14: LCA14-502: The way to a generic TrustZone® solution
LCA14: LCA14-502: The way to a generic TrustZone® solutionLCA14: LCA14-502: The way to a generic TrustZone® solution
LCA14: LCA14-502: The way to a generic TrustZone® solution
 
Implementing Trusted Endpoints in the Mobile World
Implementing Trusted Endpoints in the Mobile WorldImplementing Trusted Endpoints in the Mobile World
Implementing Trusted Endpoints in the Mobile World
 
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
 
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
 
Top 10 secure boot mistakes
Top 10 secure boot mistakesTop 10 secure boot mistakes
Top 10 secure boot mistakes
 
Solnik secure enclaveprocessor-pacsec
Solnik secure enclaveprocessor-pacsecSolnik secure enclaveprocessor-pacsec
Solnik secure enclaveprocessor-pacsec
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
 
Secure IOT Gateway
Secure IOT GatewaySecure IOT Gateway
Secure IOT Gateway
 
Software Attacks on Hardware Wallets
Software Attacks on Hardware WalletsSoftware Attacks on Hardware Wallets
Software Attacks on Hardware Wallets
 
FIPS 140-2 Validations in a Secure Enclave
FIPS 140-2 Validations in a Secure EnclaveFIPS 140-2 Validations in a Secure Enclave
FIPS 140-2 Validations in a Secure Enclave
 

Mais de Riscure

Secure Boot Under Attack: Simulation to Enhance Fault Attacks & Defenses
Secure Boot Under Attack: Simulation to Enhance Fault Attacks & DefensesSecure Boot Under Attack: Simulation to Enhance Fault Attacks & Defenses
Secure Boot Under Attack: Simulation to Enhance Fault Attacks & DefensesRiscure
 
PEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyPEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyRiscure
 
Riscure Assurance for Premium Content at a glance
Riscure Assurance for Premium Content at a glanceRiscure Assurance for Premium Content at a glance
Riscure Assurance for Premium Content at a glanceRiscure
 
Lowering the bar: deep learning for side-channel analysis
Lowering the bar: deep learning for side-channel analysisLowering the bar: deep learning for side-channel analysis
Lowering the bar: deep learning for side-channel analysisRiscure
 
Fault Injection on Automotive Diagnosis Protocols
Fault Injection on Automotive Diagnosis ProtocolsFault Injection on Automotive Diagnosis Protocols
Fault Injection on Automotive Diagnosis ProtocolsRiscure
 
CheapSCAte: Attacking IoT with less than $60
CheapSCAte: Attacking IoT with less than $60CheapSCAte: Attacking IoT with less than $60
CheapSCAte: Attacking IoT with less than $60Riscure
 
Riscure Introduction
Riscure IntroductionRiscure Introduction
Riscure IntroductionRiscure
 
Bypassing Secure Boot using Fault Injection
Bypassing Secure Boot using Fault InjectionBypassing Secure Boot using Fault Injection
Bypassing Secure Boot using Fault InjectionRiscure
 
Practical Differential Fault Attack on AES
Practical Differential Fault Attack on AESPractical Differential Fault Attack on AES
Practical Differential Fault Attack on AESRiscure
 
Java Card Security
Java Card SecurityJava Card Security
Java Card SecurityRiscure
 
How to secure electronic passports
How to secure electronic passportsHow to secure electronic passports
How to secure electronic passportsRiscure
 
How multi-fault injection breaks the security of smart cards
How multi-fault injection breaks the security of smart cardsHow multi-fault injection breaks the security of smart cards
How multi-fault injection breaks the security of smart cardsRiscure
 
Why is it so hard to make secure chips?
Why is it so hard to make secure chips?Why is it so hard to make secure chips?
Why is it so hard to make secure chips?Riscure
 
How to secure HCE
How to secure HCEHow to secure HCE
How to secure HCERiscure
 
Why are we still vulnerable to Side Channel Attacks?
Why are we still vulnerable to Side Channel Attacks?Why are we still vulnerable to Side Channel Attacks?
Why are we still vulnerable to Side Channel Attacks?Riscure
 
Defeating RSA Multiply-Always and Message Blinding Countermeasures
Defeating RSA Multiply-Always and Message Blinding CountermeasuresDefeating RSA Multiply-Always and Message Blinding Countermeasures
Defeating RSA Multiply-Always and Message Blinding CountermeasuresRiscure
 

Mais de Riscure (16)

Secure Boot Under Attack: Simulation to Enhance Fault Attacks & Defenses
Secure Boot Under Attack: Simulation to Enhance Fault Attacks & DefensesSecure Boot Under Attack: Simulation to Enhance Fault Attacks & Defenses
Secure Boot Under Attack: Simulation to Enhance Fault Attacks & Defenses
 
PEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyPEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot Securely
 
Riscure Assurance for Premium Content at a glance
Riscure Assurance for Premium Content at a glanceRiscure Assurance for Premium Content at a glance
Riscure Assurance for Premium Content at a glance
 
Lowering the bar: deep learning for side-channel analysis
Lowering the bar: deep learning for side-channel analysisLowering the bar: deep learning for side-channel analysis
Lowering the bar: deep learning for side-channel analysis
 
Fault Injection on Automotive Diagnosis Protocols
Fault Injection on Automotive Diagnosis ProtocolsFault Injection on Automotive Diagnosis Protocols
Fault Injection on Automotive Diagnosis Protocols
 
CheapSCAte: Attacking IoT with less than $60
CheapSCAte: Attacking IoT with less than $60CheapSCAte: Attacking IoT with less than $60
CheapSCAte: Attacking IoT with less than $60
 
Riscure Introduction
Riscure IntroductionRiscure Introduction
Riscure Introduction
 
Bypassing Secure Boot using Fault Injection
Bypassing Secure Boot using Fault InjectionBypassing Secure Boot using Fault Injection
Bypassing Secure Boot using Fault Injection
 
Practical Differential Fault Attack on AES
Practical Differential Fault Attack on AESPractical Differential Fault Attack on AES
Practical Differential Fault Attack on AES
 
Java Card Security
Java Card SecurityJava Card Security
Java Card Security
 
How to secure electronic passports
How to secure electronic passportsHow to secure electronic passports
How to secure electronic passports
 
How multi-fault injection breaks the security of smart cards
How multi-fault injection breaks the security of smart cardsHow multi-fault injection breaks the security of smart cards
How multi-fault injection breaks the security of smart cards
 
Why is it so hard to make secure chips?
Why is it so hard to make secure chips?Why is it so hard to make secure chips?
Why is it so hard to make secure chips?
 
How to secure HCE
How to secure HCEHow to secure HCE
How to secure HCE
 
Why are we still vulnerable to Side Channel Attacks?
Why are we still vulnerable to Side Channel Attacks?Why are we still vulnerable to Side Channel Attacks?
Why are we still vulnerable to Side Channel Attacks?
 
Defeating RSA Multiply-Always and Message Blinding Countermeasures
Defeating RSA Multiply-Always and Message Blinding CountermeasuresDefeating RSA Multiply-Always and Message Blinding Countermeasures
Defeating RSA Multiply-Always and Message Blinding Countermeasures
 

Último

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Último (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Secure initialization of Trusted Execution Environments: When Secure Boot falls short

  • 1. Cristofaro Mune (@pulsoid) Eloi Sanfelix (@esanfelix) when secure boot falls short… Secure Initialization of TEEs EuskalHack 2017
  • 2. • Cristofaro Mune − Embedded Security Consultant (Independent) − Keywords: TEEs, IoT, Embedded SW & HW, Fault Injection − Previous work: WBC, IoT, Embedded Exploitation, Mobile • Eloi Sanfelix − Principal Security Analyst @Riscure − Keywords: Software security, TEE, RE, Exploiting, SCA/FI, CTF − Previous work: WBC, DRM, PayTV, Smart Cards Who?
  • 3. • TEEs Increasingly relevant in security solutions …Basically everywhere • Research: • Interesting but limited in amount and scope • Lack of a generic TEE security modeling • Components and Mechanisms • Attack surfaces • Attack vectors What and why…
  • 5. • Aimed at providing a secure environment for execution of security critical tasks: − Payment applications − DRM applications − … • Separated from Rich execution environment (REE) − Non-secure, untrusted environment • Support for Trusted Application (TAs): − Separated from each other − Typically implementing one single use case Trusted Execution Environment (TEE)
  • 7. 1. TEE separations: 1. Separation from the Rich Execution Environment (REE) 2. Separation between TAs and the TEE OS 3. Separation between TAs TEE Critical items Strong cooperation between HW & SW We focus on this… …but concepts also apply to these.
  • 8. HW & SW roles Hardware protecting Software Software protecting secrets
  • 9. A TEE reference frame (runtime) H/W Platform TEE OS Drivers SDK TA System TAs 1 2 3 4 6 5 REE TEE Execution Memory I/O Inter-process (MMU) HW primitives for separations TEE Trusted Code Base (TCB): Can remove any protection
  • 13. Security State propagation ARM TZ core AMBA AXI3 bus DDR Flash GPU... AxPROT[1] indicates if transaction Secure or Non-Secure
  • 14. • All AXI slaves are memory mapped − Including DDR, HW registers, etc. − Page Table Entries include an NS-bit • AxPROT[1] depends on CPU and PTE NS bits How is AxPROT[1] determined? CPU NS PTE NS AxPROT[1] 0 0 0 0 1 1 1 x 1
  • 15. Example SoC: protection enforcement
  • 18. • AXI slaves in charge of enforcing transaction security • Can be done with: − Controllers (TZASC, TZPC, etc) − Hardcoded logic in bus matrix • Controllers MUST be configured by SW What about other slaves?
  • 20. Why Secure Boot? − Integrity and confidentiality of flash contents not assured • TEE security is not established! − Secure Boot provides this assurance CPU FLASH DDR ROM OTP Debug BL1.2 … BL1.1 SRAM BL1.1 STACK BL1.2 … Generic Embedded System
  • 21. Typical Secure Boot implementation Internal ROM Bootloader 1 (BL1) RSA key signature … − Assures integrity (and confidentiality) of flash contents − Root of trust composed of immutable code and data
  • 22. SB vulnerability: Samsung Galaxy S4 1. aboot copies header, then kernel 2. Signature is verified and kernel booted if OK. CPU FLASH DDR ROM OTP Debug Generic Embedded System Header … aboot SRAM aboot STACK Header … Source: Azimuth Security, Exploiting Samsung Galaxy S4 Secure Boot Kernel Kernel
  • 23. Any problems? Untrusted  Arbitrary memory corruption Source: Azimuth Security, Exploiting Samsung Galaxy S4 Secure Boot
  • 24. So what? − aboot smashes its own code with attacker-supplied code! − Alternatively, attacker could target return address on stack Source: Azimuth Security, Exploiting Samsung Galaxy S4 Secure Boot CPU FLASH DDR ROM OTP Debug Header … aboot SRAM aboot STACK Header Kernel Kernel Generic Embedded System
  • 25. SB vulnerability: AMLogic S905 SoC Source: http://www.fredericb.info/2016/10/amlogic-s905-soc-bypassing-not-so.html Untrusted data used to determine whether signature check is enabled!
  • 26. • Secure Boot makes sure code is authentic − You still need to set up the REE and TEE! • In particular: − Initialize separations (TZASC, TZPC, … ) − Load TEE OS into Secure World − Initialize other SoC components Beyond Secure Boot The TEE needs to be securely initialized before running any REE code!
  • 28. • TEE initialization is based on Secure Boot. • TEE initialization must also protect, load, verify, initialize and configure the TEE. • Then demote to REE. TEE initialization
  • 29. A TEE reference frame (full) H/W Platform Root of Trust Boot stages TEE OS Drivers SDK TA System TAs 1 2 3 4 6 5 7 8 REE TEE Execution Memory I/O Inter-process (MMU) HW primitives for separations TEE Trusted Code Base (TCB): Can remove any protection
  • 30. • Demotion point: − The point (in time & code) in a boot process, where ALL the privileges for configuring a TEE are given up − …and REE is started. • Critical path(s): − The set of all the code paths that can be executed before the Demotion point − Parts of the TEE attack surface Some definitions
  • 31. How it works: Old Samsung phone iROM BL1 BL2 PBL TZSW Signed/encrypted Signed Signed Android SECKEYRestricted External Load + Exec Exec Load Signed REE execution Critical paths Demotion to REE
  • 32. • The following must be executed before Demotion point • For each TEE-related boot stage: − Identify WHERE to load the stage in memory − Protect memory from REE - E.G. configure TZASC − Load and Verify. − Run any stage initialization code • Configure (…more to come…) − Other IPs − Other Protection Controllers Just “Secure Boot”?
  • 33. • Reference implementation for trusted TEE initialization − ARMv8-A architecture − ATF v1.3 now released - Security improvements over v1.2 • Customizations needed: − Highly dependent on memory layout (and design) − Examples: - Configuration of TZASC and TZPC  …or equivalent controllers - Initialization routines for BL31 and BL32 ARM Trusted Firmware
  • 35. • One of TEE security foundations − Is it Secure or Non-Secure Memory? Range checks How difficult can it be?
  • 36. • TEE ranges can be dynamic (and scattered) − Hardcoded values may be difficult to handle • Logical mistakes may happen…. Real world example https://atredispartners.blogspot.com.mt/2014/08/here-be-dragons-vulnerabilities-in.html
  • 37. • Multiple memories: − Not everything is DDR • Layout can be dynamic: − Example: Video Memory • Proper check location and API design are fundamental • System-level consistency of view is needed for proper enforcement: − Across every SW runtime component − Across the whole SoC HW. Range checks not so easy…
  • 40. • SoC much more than the ARM CPU • DMA engines − Crypto accelerators − PCI/PCIe devices • Other processing engines − Audio/Video CPUs − Modem and WiFi controllers − Power management MCUs Potential attack surface Any IP with access to the bus MUST be considered!
  • 41. • Most masters are also slaves − DMA transactions configured through the bus − Auxiliary CPUs expose APIs through the bus − … • Need to take care of configuration − Secure bus masters should not be driven by non-secure processing engines − Firmware running on secure bus masters should be authenticated and secured! Buses, masters and slaves
  • 42. Example: HW crypto engine DDR REE Apps Secure DDR REE Code/Data HW AES Engine Encrypted content TEE Code/Data Decrypted content REE OS TAs TEE OS “Decrypt from A to B” SecureNon-secure
  • 43. What if… ? DDR REE Apps Secure DDR REE Code/Data HW AES Engine Encrypted content TEE Code/Data REE OS TAs TEE OS “Decrypt from A to B” SecureNon-secure
  • 44. • Some use cases might require isolating peripherals − Secure display to show mobile payment data − Secure touch sensor for PIN entry − Secure fingerprint sensor • But some peripherals need to be available to both worlds  Runtime configuration required Securing peripherals State transitions must be carefully considered
  • 46. • Simply put: Boot after “Suspend-To-RAM” − Typically requested from REE • Only some parts of the SoC are powered down: − DDR in self-refresh mode − Some limited parts always-on for restore • Restore/reuse saved execution contexts − E.g: Entry points Warm Boot
  • 47. • Contexts are not fully stored in TEE memory? • Protection controllers are shutdown as well? • Contexts are stored in non-DDR memory? − E.G. some on-chip SRAM • Remaining execution cores are non-secure? − Do they have access to memory storing contexts? What if…
  • 49. • TEE security can be complex: − Full HW & SW cooperation continuously required • TEE initialization is critical • HW can also be an attacker… • More accurate TEE security model needed: − Properly frame attacks, discussions and design choices • Holistic view required Conclusion TEE is an environment… …not “just” a feature.
  • 50. Thank you!! Cristofaro Mune (@pulsoid) pulsoid@icysilence.org Eloi Sanfelix (@esanfelix) eloi@riscure.com