SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Presented by
Date
Event
SFO15-503: Secure storage
in OP-TEE
James Kung, SY ChiuJames Kung, Sheng-Yu Chiu
Friday 25 September 2015
SFO15
Agenda
● Overview
● Key Manager
● Atomic Operations
● Future Work
Secure Storage System Architecture
REE File Operation Interface
TEE Supplicant
TEE DriverREE
FileSystem TEE FileSystem Key
Manager
TEE File Operation Interface
TEE Trusted Storage Service
TATATA
GP Trusted Storage API
Support Atomic Operations
Normal World Secure World
UserSpaceKernelSpace
GP Trusted Storage Requirement
From GlobalPlatform TEE Internal Core API v1.1:
(section 2.5 and section 5.2)
● Must be bound to a particular device
● Guarantees on the confidentiality and integrity of the data
● Guarantees on the atomicity of the operations that modify the storage
● Ability to hide sensitive key material from the TA itself
● Separation of storage among different TAs
● Provide protection against rollback attacks (future work)
TEE File Operation Interface
int (*open)(const char *file, int flags, ...);
int (*close)(int fd);
int (*read)(int fd, void *buf, size_t len);
int (*write)(int fd, const void *buf, size_t len);
tee_fs_off_t (*lseek)(int fd, tee_fs_off_t offset, int whence);
int (*rename)(const char *old, const char *new);
int (*unlink)(const char *file);
int (*ftruncate)(int fd, tee_fs_off_t length);
int (*access)(const char *name, int mode);
int (*mkdir)(const char *path, tee_fs_mode_t mode);
tee_fs_dir *(*opendir)(const char *name);
int (*closedir)(tee_fs_dir *d);
struct tee_fs_dirent *(*readdir)(tee_fs_dir *d);
int (*rmdir)(const char *pathname);
TEE Storage And File Structure In REE
File System
block 0
block 1
block N
● Provide separate folder for each TA
● TEE filename == object id (provided by TA)
● TEE file == a folder contains a meta file and
several block files (folder name is object id)
● Meta file
○ Storing info. of a TEE file. e.g. file length.
○ Always encrypted
● block file
○ Storing TEE file data
○ Optionally encrypted depends on the
compile time flag - CFG_ENC_FS
/data/tee/
<obj-id>/
<ta-uuid>/
meta
* default max. data size in
block file is 4KB
* default max. number of
blocks is 1024
* default max TEE file size
= 4MB (4KB * 1024)
● Overview
● Key Manager
● Atomic Operations
● Future Work
Key Manager
● Provide file encryption/decryption functions
● Key management
○ Secure Storage Key (SSK)
■ Per-device key
■ Used by secure storage subsystem for FEK
encryption/decryption
■ Generated and stored in secure memory at boot time
○ File Encryption Key (FEK)
■ Per-file key
■ Used for TEE file encryption/decryption
■ Generated, encrypted and stored in meta file when a
new TEE file is created
Key Derivation
● Secure Storage Key (SSK)
○ SSK = HMACSHA256
(HUK, Chip ID || “static string”)
○ HUK: Hardware Unique Key
● File Encryption Key (FEK)
○ By default, generated by Fortuna (PRNG*)
○ Default key length: 128 bits
* It is better to leverage platform H/W RNG(TRNG) if your platform supports that
* Can be implemented in platform porting layer
* To avoid other
subsystems to generate
the same per-device key
Meta Data Encryption
Meta IV Tag Encrypted Meta Data
AESECB
SSK
FEK
AESGCM
Meta DataMeta IVEncrypted FEK
Encrypted FEK
Generated by PRNG, and default length is 96 bits
Meta Data = {
TEE_file_data_length;
backup_version_table[number of blocks];
}
Meta File:
AAD
Block Data Encryption
Block IV Tag Encrypted Block Data
AESECB
SSK
FEK
AESGCM
Block DataBlock IV
Generated by PRNG, and default length is 96 bits
...Encrypted FEKMeta File:
Block File:
Decryption
● Overview
● Key Manager
● Atomic Operations
● Future Work
What is Atomic Update
● Each update can only have two results
○ Update succeed
○ Update failed, rollback to old version
● We cannot modify the file contents directly
○ Out-of-place update
○ Modify a copy of file content instead
Changes to Support Out-of-place Update
data.0 data.1
write datawrite data
● Both Meta and Block file has an
additional attribute called backup
version, backup version is 0 or 1
● We toggle the backup version each
time when we want to update
something
● We should follow the step to update
meta or block file
How to Keep Track Backup Version
Meta.0 Block0.0
Block1.1
BlockN.0
0 1 1 0
version table
● Introduce a version table in meta
data, which stores the backup
version of each Block file. This is
used to keep track of the backup
version of each block file.
Block2.1
GP Internal Core API Says...
● The following operations should be atomic
○ Write
○ Truncate
○ Rename
○ Create/Delete
Ensure Atomic Operation
Commit stage
Write new meta file to storage (commit the change).
Remove old meta file
Out-of-place update stage
Any fault here would cause a failed update
(no changes has been made)
Clean-up stage
Any fault here was ignored
(changes has been made)
* should having a tool to do garbage collection to clean up invalid block
or meta. The idea is similar to fsck for Linux file system.
Atomic Write Operation
block0.0
block1.1
block0.1
(in memory)
meta.0
0 1
meta.1
0 11
Assume block size is 1KB, we want to write 20 Bytes at position 0
write data
Atomic Truncate Operation
meta.0
block0.0
block1.1
meta.1
(in memory)
Assume block size is 1KB, file length is 1.5 KB, we want to truncate it
to 500 Bytes
len:1.5KB len:1.5KBlen:500B
REE path: .../bar/REE path: .../foo/
Atomic Rename Operation
meta.0
block0.0
block1.1
meta.0
block0.0
block1.1
hard link
Assume we want to rename foo to bar
* ISO C requires rename to be atomic. We are considering to use it.
** Atomic override is not supported yet.
Atomic Create/Delete Operation
● Create
○ If the meta file is successfully encrypted and stored,
we are done.
○ If any failure occurs during meta file creation, no file
is created.
● Delete
○ Rename <filename> to <filename>.trash
○ Then remove <filename>.trash
* unlink is not need to be atomic. Thus we can’t simply unlink(‘meta’)
● Overview
● Key Manager
● Atomic Operations
● Future Work
Binding TEE File to TA
● TEE file folder can be copied or moved into other TA’s
folder in normal world
● We do not have a mechanism to prevent TA’s from
opening other TA’s TEE file(s)
● A simple way to bind TEE file to TA is adding TA’s UUID
to meta file
Rollback Attack Detection
● TEE file content can be backed up and then restored
without any error. TEE should be able to detect this kind
of actions.
● The solution is to add a file version number in meta file
and store it in another safe place.
● The safe place can be
○ normal world file system (Protection Level = 100)
○ RPMB (Protection Level = 1000)
Thank you~

Weitere ähnliche Inhalte

Was ist angesagt?

LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platform
Linaro
 
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
Linaro
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
Houcheng Lin
 

Was ist angesagt? (20)

LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platform
 
Lcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future EnhancementsLcu14 306 - OP-TEE Future Enhancements
Lcu14 306 - OP-TEE Future Enhancements
 
Introduction to Optee (26 may 2016)
Introduction to Optee (26 may 2016)Introduction to Optee (26 may 2016)
Introduction to Optee (26 may 2016)
 
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
 
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
 
BUD17-400: Secure Data Path with OPTEE
BUD17-400: Secure Data Path with OPTEE BUD17-400: Secure Data Path with OPTEE
BUD17-400: Secure Data Path with OPTEE
 
LCA14: LCA14-418: Testing a secure framework
LCA14: LCA14-418: Testing a secure frameworkLCA14: LCA14-418: Testing a secure framework
LCA14: LCA14-418: Testing a secure framework
 
BKK16-201 Play Ready OPTEE Integration with Secure Video Path lhg-1
BKK16-201 Play Ready OPTEE Integration with Secure Video Path lhg-1BKK16-201 Play Ready OPTEE Integration with Secure Video Path lhg-1
BKK16-201 Play Ready OPTEE Integration with Secure Video Path lhg-1
 
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
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted Firmware
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEE
 
OPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialOPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build Tutorial
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
 
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARMSFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
SFO15-205: OP-TEE Content Decryption with Microsoft PlayReady on ARM
 
Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
DAIS19: On the Performance of ARM TrustZone
DAIS19: On the Performance of ARM TrustZoneDAIS19: On the Performance of ARM TrustZone
DAIS19: On the Performance of ARM TrustZone
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
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...
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 

Ähnlich wie SFO15-503: Secure storage in OP-TEE

Encompassing Information Integration
Encompassing Information IntegrationEncompassing Information Integration
Encompassing Information Integration
nguyenfilip
 
LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)
Linaro
 

Ähnlich wie SFO15-503: Secure storage in OP-TEE (20)

EuroPython 2015 - Storing files for the web is not as straightforward as you ...
EuroPython 2015 - Storing files for the web is not as straightforward as you ...EuroPython 2015 - Storing files for the web is not as straightforward as you ...
EuroPython 2015 - Storing files for the web is not as straightforward as you ...
 
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo RickliOSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
 
mdc_ppt
mdc_pptmdc_ppt
mdc_ppt
 
PyConIT6 - MAKING SESSIONS AND CACHING ROOMMATES
PyConIT6 - MAKING SESSIONS AND CACHING ROOMMATESPyConIT6 - MAKING SESSIONS AND CACHING ROOMMATES
PyConIT6 - MAKING SESSIONS AND CACHING ROOMMATES
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
 
Osdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talkOsdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talk
 
Introducing PMDK into PostgreSQL
Introducing PMDK into PostgreSQLIntroducing PMDK into PostgreSQL
Introducing PMDK into PostgreSQL
 
Encompassing Information Integration
Encompassing Information IntegrationEncompassing Information Integration
Encompassing Information Integration
 
Linux Kernel Platform Development: Challenges and Insights
 Linux Kernel Platform Development: Challenges and Insights Linux Kernel Platform Development: Challenges and Insights
Linux Kernel Platform Development: Challenges and Insights
 
PyConFR 2014 - DEPOT, Story of a file.write() gone wrong
PyConFR 2014 - DEPOT, Story of a file.write() gone wrongPyConFR 2014 - DEPOT, Story of a file.write() gone wrong
PyConFR 2014 - DEPOT, Story of a file.write() gone wrong
 
Spark and S3 with Ryan Blue
Spark and S3 with Ryan BlueSpark and S3 with Ryan Blue
Spark and S3 with Ryan Blue
 
Speed up large-scale ML/DL offline inference job with Alluxio
Speed up large-scale ML/DL offline inference job with AlluxioSpeed up large-scale ML/DL offline inference job with Alluxio
Speed up large-scale ML/DL offline inference job with Alluxio
 
LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Ingestion file copy using apex
Ingestion   file copy using apexIngestion   file copy using apex
Ingestion file copy using apex
 
ApacheCon 2022: From Column-Level to Cell-Level_ Towards Finer-grained Encryp...
ApacheCon 2022: From Column-Level to Cell-Level_ Towards Finer-grained Encryp...ApacheCon 2022: From Column-Level to Cell-Level_ Towards Finer-grained Encryp...
ApacheCon 2022: From Column-Level to Cell-Level_ Towards Finer-grained Encryp...
 
Mongodb meetup
Mongodb meetupMongodb meetup
Mongodb meetup
 
Introduction to Magento
Introduction to MagentoIntroduction to Magento
Introduction to Magento
 
Percona XtraBackup - New Features and Improvements
Percona XtraBackup - New Features and ImprovementsPercona XtraBackup - New Features and Improvements
Percona XtraBackup - New Features and Improvements
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
 

Mehr von Linaro

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Linaro
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
Linaro
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Linaro
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
Linaro
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
Linaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
Linaro
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
Linaro
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
Linaro
 

Mehr von Linaro (20)

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
 
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qa
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening Keynote
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8M
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[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
 
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
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 
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
 

SFO15-503: Secure storage in OP-TEE

  • 1. Presented by Date Event SFO15-503: Secure storage in OP-TEE James Kung, SY ChiuJames Kung, Sheng-Yu Chiu Friday 25 September 2015 SFO15
  • 2. Agenda ● Overview ● Key Manager ● Atomic Operations ● Future Work
  • 3. Secure Storage System Architecture REE File Operation Interface TEE Supplicant TEE DriverREE FileSystem TEE FileSystem Key Manager TEE File Operation Interface TEE Trusted Storage Service TATATA GP Trusted Storage API Support Atomic Operations Normal World Secure World UserSpaceKernelSpace
  • 4. GP Trusted Storage Requirement From GlobalPlatform TEE Internal Core API v1.1: (section 2.5 and section 5.2) ● Must be bound to a particular device ● Guarantees on the confidentiality and integrity of the data ● Guarantees on the atomicity of the operations that modify the storage ● Ability to hide sensitive key material from the TA itself ● Separation of storage among different TAs ● Provide protection against rollback attacks (future work)
  • 5. TEE File Operation Interface int (*open)(const char *file, int flags, ...); int (*close)(int fd); int (*read)(int fd, void *buf, size_t len); int (*write)(int fd, const void *buf, size_t len); tee_fs_off_t (*lseek)(int fd, tee_fs_off_t offset, int whence); int (*rename)(const char *old, const char *new); int (*unlink)(const char *file); int (*ftruncate)(int fd, tee_fs_off_t length); int (*access)(const char *name, int mode); int (*mkdir)(const char *path, tee_fs_mode_t mode); tee_fs_dir *(*opendir)(const char *name); int (*closedir)(tee_fs_dir *d); struct tee_fs_dirent *(*readdir)(tee_fs_dir *d); int (*rmdir)(const char *pathname);
  • 6. TEE Storage And File Structure In REE File System block 0 block 1 block N ● Provide separate folder for each TA ● TEE filename == object id (provided by TA) ● TEE file == a folder contains a meta file and several block files (folder name is object id) ● Meta file ○ Storing info. of a TEE file. e.g. file length. ○ Always encrypted ● block file ○ Storing TEE file data ○ Optionally encrypted depends on the compile time flag - CFG_ENC_FS /data/tee/ <obj-id>/ <ta-uuid>/ meta * default max. data size in block file is 4KB * default max. number of blocks is 1024 * default max TEE file size = 4MB (4KB * 1024)
  • 7. ● Overview ● Key Manager ● Atomic Operations ● Future Work
  • 8. Key Manager ● Provide file encryption/decryption functions ● Key management ○ Secure Storage Key (SSK) ■ Per-device key ■ Used by secure storage subsystem for FEK encryption/decryption ■ Generated and stored in secure memory at boot time ○ File Encryption Key (FEK) ■ Per-file key ■ Used for TEE file encryption/decryption ■ Generated, encrypted and stored in meta file when a new TEE file is created
  • 9. Key Derivation ● Secure Storage Key (SSK) ○ SSK = HMACSHA256 (HUK, Chip ID || “static string”) ○ HUK: Hardware Unique Key ● File Encryption Key (FEK) ○ By default, generated by Fortuna (PRNG*) ○ Default key length: 128 bits * It is better to leverage platform H/W RNG(TRNG) if your platform supports that * Can be implemented in platform porting layer * To avoid other subsystems to generate the same per-device key
  • 10. Meta Data Encryption Meta IV Tag Encrypted Meta Data AESECB SSK FEK AESGCM Meta DataMeta IVEncrypted FEK Encrypted FEK Generated by PRNG, and default length is 96 bits Meta Data = { TEE_file_data_length; backup_version_table[number of blocks]; } Meta File: AAD
  • 11. Block Data Encryption Block IV Tag Encrypted Block Data AESECB SSK FEK AESGCM Block DataBlock IV Generated by PRNG, and default length is 96 bits ...Encrypted FEKMeta File: Block File: Decryption
  • 12. ● Overview ● Key Manager ● Atomic Operations ● Future Work
  • 13. What is Atomic Update ● Each update can only have two results ○ Update succeed ○ Update failed, rollback to old version ● We cannot modify the file contents directly ○ Out-of-place update ○ Modify a copy of file content instead
  • 14. Changes to Support Out-of-place Update data.0 data.1 write datawrite data ● Both Meta and Block file has an additional attribute called backup version, backup version is 0 or 1 ● We toggle the backup version each time when we want to update something ● We should follow the step to update meta or block file
  • 15. How to Keep Track Backup Version Meta.0 Block0.0 Block1.1 BlockN.0 0 1 1 0 version table ● Introduce a version table in meta data, which stores the backup version of each Block file. This is used to keep track of the backup version of each block file. Block2.1
  • 16. GP Internal Core API Says... ● The following operations should be atomic ○ Write ○ Truncate ○ Rename ○ Create/Delete
  • 17. Ensure Atomic Operation Commit stage Write new meta file to storage (commit the change). Remove old meta file Out-of-place update stage Any fault here would cause a failed update (no changes has been made) Clean-up stage Any fault here was ignored (changes has been made) * should having a tool to do garbage collection to clean up invalid block or meta. The idea is similar to fsck for Linux file system.
  • 18. Atomic Write Operation block0.0 block1.1 block0.1 (in memory) meta.0 0 1 meta.1 0 11 Assume block size is 1KB, we want to write 20 Bytes at position 0 write data
  • 19. Atomic Truncate Operation meta.0 block0.0 block1.1 meta.1 (in memory) Assume block size is 1KB, file length is 1.5 KB, we want to truncate it to 500 Bytes len:1.5KB len:1.5KBlen:500B
  • 20. REE path: .../bar/REE path: .../foo/ Atomic Rename Operation meta.0 block0.0 block1.1 meta.0 block0.0 block1.1 hard link Assume we want to rename foo to bar * ISO C requires rename to be atomic. We are considering to use it. ** Atomic override is not supported yet.
  • 21. Atomic Create/Delete Operation ● Create ○ If the meta file is successfully encrypted and stored, we are done. ○ If any failure occurs during meta file creation, no file is created. ● Delete ○ Rename <filename> to <filename>.trash ○ Then remove <filename>.trash * unlink is not need to be atomic. Thus we can’t simply unlink(‘meta’)
  • 22. ● Overview ● Key Manager ● Atomic Operations ● Future Work
  • 23. Binding TEE File to TA ● TEE file folder can be copied or moved into other TA’s folder in normal world ● We do not have a mechanism to prevent TA’s from opening other TA’s TEE file(s) ● A simple way to bind TEE file to TA is adding TA’s UUID to meta file
  • 24. Rollback Attack Detection ● TEE file content can be backed up and then restored without any error. TEE should be able to detect this kind of actions. ● The solution is to add a file version number in meta file and store it in another safe place. ● The safe place can be ○ normal world file system (Protection Level = 100) ○ RPMB (Protection Level = 1000)