Building a Product with OP-TEE Possible pitfalls while deploying - - PowerPoint PPT Presentation

building a product with op tee
SMART_READER_LITE
LIVE PREVIEW

Building a Product with OP-TEE Possible pitfalls while deploying - - PowerPoint PPT Presentation

Building a Product with OP-TEE Possible pitfalls while deploying OP-TEE in production Rouven Czerwinski r.czerwinski@pengutronix.de https://www.pengutronix.de About me Rouven Czerwinski Pengutronix e.K. Emantor rcz@pengutronix.de


slide-1
SLIDE 1

https://www.pengutronix.de

Building a Product with OP-TEE

Possible pitfalls while deploying OP-TEE in production Rouven Czerwinski– r.czerwinski@pengutronix.de

slide-2
SLIDE 2

2/21

About me

Rouven Czerwinski Pengutronix e.K.  Emantor  rcz@pengutronix.de

 OP-TEE 

System Integration

 T

esting

slide-3
SLIDE 3

3/21

T able of Contents

Short overview:

 Introduction  Motivation  Problems  Solutions  Conclusion  Outlook

slide-4
SLIDE 4

4/21

TrustZone (32-bit)

slide-5
SLIDE 5

5/21

Introduction

 Open Portable T

rusted Execution Environment (OP-TEE)

 Open source (BSD-2 clause)

implementation of the GP TEE specifjcation using T rustZone

 Support for various ARM platforms

(STM32, TI, Layerscape, broadcom,…)

 My focus is on i.MX6 platforms

slide-6
SLIDE 6

6/21

Motivation

 Secure the OP-TEE and TAs for production

use

 Ensure that upstream OP-TEE can be used

securely on i.MX6

 Provide guidance which parts may be

missing for other platforms (TI, STM, Layerscape,…)

slide-7
SLIDE 7

7/21

Problem

 Which components do I need to secure

OP-TEE?

 Which part of the confjguration is already

upstream?

 Which part needs to be managed by

system integrator?

slide-8
SLIDE 8

8/21

Securing upstream OP-TEE

 RAM protection/Pager  Hardware Unique Key (HUK)  RNG Seeding  Peripheral Access Confjguration  Ensure trusted OP-TEE bootup  Optional: storage rollback protection

slide-9
SLIDE 9

9/21

RAM protection

 Confjgure the DDR fjrewall  Protects part of RAM for secure world  i.e. TZC380 with multiple regions  For i.MX6:

 TZC380 from ARM  Upstream driver already within OP-TEE

slide-10
SLIDE 10

10/21

i.MX6 TZC380 autoconfjguration

 TZC380 auto confjguration upstream  Correctly confjgures TZC380 for generic

RAM devices with known memory layout

slide-11
SLIDE 11

11/21

OP-TEE Pager

 Run small part of OP-TEE in SRAM  Encrypt other memory pages live in DRAM  Does not require a DDR fjrewall  For i.MX6:

 Chosen i.MX6UL may not have enough SRAM  Bigger variants may use SRAM for other use

cases (IPU, GPU,…)

slide-12
SLIDE 12

12/21

Hardware Unique Key (HUK)

 Used to derive other keys for OP-TEE  Should be unique per device  Should not be accessible from normal

world

 For i.MX6:

 Use CAAM Master Key Verifjcation Blob

(MKVB) and lockout generation afterwards

slide-13
SLIDE 13

13/21

i.MX6 HUK generation

 Needs rebase on i.MX6/7 CAAM driver  Will be done soon™

slide-14
SLIDE 14

14/21

RNG seeding

 OP-TEE uses FORTUNA PRNG  Requires RNG seed  Default seed for dev is zero  For i.MX6:

 Retrieve RNG from CAAM TRNG on bootup  Not implemented yet

slide-15
SLIDE 15

15/21

Peripheral Access Confjguration

 SoCs have DMA masters beside CPU  Those masters may be default secure and

can access secure world memory

 For i.MX6:

 Access policies confjgurable via Central

Security Unit (CSU)

slide-16
SLIDE 16

16/21

i.MX6 CSU

 Upstream confjgures correctly for i.MX6UL  Other i.MX6/7 SoCs trivial to add (given

Security Reference Manual)

slide-17
SLIDE 17

17/21

Trusted Bootup

 Use platform verifjed/secure boot  Verifjes OP-TEE version to prevent

replacements

 For i.MX6:

 Implement High Assurance Boot (HAB), also

required for HUK

 Not implementable upstream, needs to be

handled by integrator

slide-18
SLIDE 18

18/21

Storage Rollback protection

 T

  • protect from rollback attacks, employ

eMMC RPMB FS

 Simple FAT fjlesystem  For all platforms:

 Enable with CFG_RPMB_FS=1  Deploy during manufacturing with

CFG_RPMB_WRITE_KEY=1

 Ensure to disable emulation in TEE Supplicant

with RPMB_EMU=0

 Support upstream

slide-19
SLIDE 19

19/21

Conclusion

 No platform is currently ready to deploy

OP-TEE in production

 i.MX6 is slowly getting there

 Vendor implementations may include the

necessary bits

 Still requires code review and cross reference

to platform manual

slide-20
SLIDE 20

20/21

Outlook (Wishlist)

 Clock and access coordination between

OP-TEE and Linux

 Deeper device tree integration for OP-TEE  CI infrastructure to test each commit to

OP-TEE master for i.MX6/7

slide-21
SLIDE 21

https://www.pengutronix.de

Thank you

Questions?