SlideShare a Scribd company logo
1 of 30
Confidential © 2017 Arm Limited
Trusted Firmware M
Trusted Boot
Tamas Ban
Linaro 2018​
Arm
Non-Confidential © Arm 20182
Agenda
• Concept of trusted boot
• Bootloader in TF-M
• Firmware upgrade
• Alternatives for upgrade
• Alternatives for crypto
• Plans
• Q&A
Non-Confidential © Arm 20183
What is trusted environment?
An integrated execution environment(HW + SW) which can protect valuable assets against
extraction:
• Sensitive user data
• Crypto keys
• Firmware itself, etc.
Hardware
Trusted
Env.
Non-Confidential © Arm 20184
Introduction to trusted bootloader concept
What? Why? How?
SW whose aim is to verify
the origin and integrity of
other SW components
which run on the target
system.
• Bootloader runs as soon
as system is released from
reset prior any other SW.
In case of successful
authentication it passes
execution to the runtime
firmware.
One wants to ensure that
only a certain set of SW,
without any external
modification, can run on a
particular device.
• Device contains sensitive
assets which could be
extracted with the usage
of malicious SW.
Device contains immutable
SW and data, which can be
used for authentication:
• Integrity of SW:
– Checking hash value
• Origin of SW:
– Checking digital signature
Non-Confidential © Arm 20185
Considerations at selection of bootloader
Secure boot requirements
PSA spec defines boot and firmware
update requirements:
• Support for firmware upgrade
• Support for chain-of-trust
• Support for NIST or NSA approved
cryptographic algorithm: SHA2, RSA, ECDSA,
HMAC, KDF
• Etc.
Device constraints
Device constraints mandate `yet-another`
bootloader:
• Usually less than 1 MB flash memory for code
• Usually less than 256 KB RAM for data
• Usage of cryptographic accelerator HW
component
• Computing power
• No MMU, no memory virtualization
• Power failure awareness
• Etc.
Non-Confidential © Arm 20186
Bootloader in TF-M
MCUBoot is utilized to act as BL2 in TF-M:
• Open source project with Apache 2.0 licensing
• Low memory footprint; designed for 32 bit microcontrollers
• Running from flash(currently XIP)
• Several secure boot features are supported for firmware authentication: SHA256, RSA-
2048, (ECDSA)
• Usage of 3rd party libraries for cryptographic operations: mbedTLS, (TinyCrypt)
• Firmware update with image swapping
• Power failure resistant upgrade
• Fallback mechanism to stable version
Non-Confidential © Arm 20187
First bootloader release
MCUBoot integrated within TF-M repository:
Customized to be OS agnostic
Currently SHA256 and RSA-2048 are supported
SPE and NSPE are concatenated to a single binary blob
Hash and digital signature tooling and runtime check
Software Upgrade prototype as proof of concept:
• Emulating flash interface and behaviour over code SRAM
System constraints:
• No support for image size that does not fit in available RAM
• CoT reduced to verify SPE and NSPE in the same go
Non-Confidential © Arm 20188
Immutable
BL1 code
Chain of trust
Hash
BL2
image
SIP/OEM
Root of Trust Public Key
(ROTPK)
OEM/Developer
Public Key(s)
Use CA public key if
supporting certificate
revocation
Check
signature
Public image
signing keys
can be rotated
Check
integrity
NSPE
image
SPE
image
Check
signature
Public key
Public
key(s)
Check
signature
Non-Confidential © Arm 20189
RTOS
&
Application
Boot process
Stage
PSA
(not mandatory)
TF-M
BL1
Immutable
boot code in
ROM
Boot
code
in eFlash
BL2 NSPESPE
Secure
runtime
firmware
Verify
Load
Start
Core
SPM
Secure services
TBD
Verify
Load
Start
Verify
Load
Start
RTOS
&
Application
BL2
MCUBoot Start Start
Verify
combined hash and
signature
Non-Confidential © Arm 201810
Basic operation and memory layout
Non-Confidential © Arm 201811
6.) Copy scratch
to Slot_0
3.) Erease Slot_1
Image swapping
• Code linked to
Slot_0 memory
space
• Divided into
rounds
• Scratch-sized data
is moved in one
go
• Status info saved
after each round
• Power failure safe
Slot_1_Sector_2
Slot_1_Sector_N
Slot_1_Sector_3
Active image
Slot_0
New image
Slot_1
Slot_0_Sector_2
Slot_0_Sector_N
Slot_0_Sector_3
Scratch
area
1.) Erease scratch
Sector_0
Sector_1
Slot_0_Sector_0
Slot_0_Sector_1
Slot_1_Sector_0
Slot_1_Sector_1
2.) Copy Slot_1
to scratch
4.) Copy Slot_1
to scratch
5.) Erease Slot_0
Slot_1_Sector_1
Slot_1_Sector_0
Save swap status
info
Slot_1_Sector_0
Slot_1_Sector_1
Slot_0_Sector_0
Slot_0_Sector_1
Slot_1_Sector_1
Slot_1_Sector_0
Non-Confidential © Arm 201812
Firmware upgrade
• Upgrade is a task
of runtime FW
• Potentially split
between NSPE
and SPE
• XIP images
Non-Confidential © Arm 201813
Image fallback
• Store previous
image
• Health-check new
image with BIST
• Self confirmation
• Reboot in case of
failure
• Revert back stable
image
• Set rollback after
confirmation
Non-Confidential © Arm 201814
Design constraints
Header size - VTOR alignment:
• Device dependent 512-1024 bytes
Image slot’s layout must be aligned
Scratch area size:
• Flash memory wear-out
• At least as the largest block size
Real image size smaller than image slot:
• Image header, TLV, swap status info, etc.
No recovery option, if both images are faulty
Non-Confidential © Arm 201815
Common threats
Threat Mitigation Implemented
Malicious firmware sent to device Signed firmware images Yes
Downgrade to old vulnerable
version
Version or fallback counters
check
Not yet*
Persistent malware(rootkits)
Immutable boot code and
data(BL1)
Not yet
Remote bricking of the device Backup image Yes
Attacker gets signing key Key revocation support Not yet*
*: Planned to be addressed in 2018
Non-Confidential © Arm 201816
Alternatives to image swapping
Position independent code
Pros:
• Reduced P/E cycle leads to longer lifetime
• Reduced BL complexity and code footprint
• Reduced boot-up time(no swapping)
Cons:
• Might lead bigger firmware code footprint
• Some compiler switches are not compatible
with PIC code
• Some C lib (Microlib) cannot be compiled to
be PIC
• Other constraints when compiling code to
be PIC
Dual image build
Pros:
• Reduced P/E cycle leads to longer lifetime
• Reduced BL complexity and code footprint
• Reduced boot-up time(no swapping)
Cons:
• More complex build process
• Extra logic in update client
Non-Confidential © Arm 201817
Alternatives to image swapping
Execute from RAM
Pros:
• Reduced P/E cycle leads to longer lifetime
• Faster firmware execution
• Reduced BL complexity and code footprint
Cons:
• Usually infeasible: less RAM than ROM
Off-chip storage
Pros:
• Reduced P/E cycle leads to longer lifetime
• Reduced BL complexity and code footprint
Cons:
• Might be a security risk: when to verify
signature?
• Might require image encryption, increased
code footprint(include AES) and boot-up
time
Non-Confidential © Arm 201818
Alternatives to image swapping
Overwrite
Pros:
• Reduced P/E cycle leads to longer lifetime
• No need for scratch space
• Reduced BL complexity and code footprint
Cons:
• Risk of bricking the device because no
revert possible
Non-Confidential © Arm 201819
MCUBoot as PIC code
Experiment to compile PIC code:
• RO and RW position independent( --ropi, --rwpi)
• Vector table and IRQ handlers must be in RAM
• IRQ handling unavailable until vectors and handlers relocated to RAM
• Image size increased:
• 29KB -> 38KB; More std. C lib was compiled-in
• Limitations on source code:
• Constant pointer cannot be used
• CMSE armclang flag is not compatible with ROPI
• Microlib cannot be compiled to be position independent
Non-Confidential © Arm 201820
Comparison of crypto algorithms
RSA
• Big key size: up to 15KB
• 128 bit level of security: RSA-3072
• ROM size(mbedTLS): ~14KB
• RAM usage(mbedTLS): ~7KB
• Key generation: slower
• Signature generation: slower
• Signature verification time: faster
ECC
• Small key size: up to 512 bits
• 128 bit level of security: ECC-256
• ROM size(mbedTLS):
• RAM usage(mbedTLS): ~13KB
• Key generation: faster
• Signature generation: faster
• Signature verification : slower
Moving from RSA to ECC
Non-Confidential © Arm 201821
„Speed up asymmetric crypto”
Signature verification with RSA or ECC is time consuming
Symmetric crypto can spare clock cycles
Replace asym. crypto with symmetric: HMAC, CMAC, etc:
• Previously verified images(upgrade time) can get a MAC, generated based on Hardware
Unique Key(HUK)
• At boot time this MAC is verified instead of original signature
• Boot time can be significantly reduced
Download
new
firmware
Verify
signature
Deploy in
flash
Generate
MAC
Save to flash
Reset device
Bootloader
checks MAC
Non-Confidential © Arm 201822
Alternatives for crypto libraries
HW accelerator:
• Improved performance / reduced code footprint
CryptoCell-312:
• Symmetric and asymmetric crypto
• Runtime library: use mbedTLS API
• Boot library:
– Signature verification
– X509 certificate parsing
– Image verification and optional
decryption
• Asset provisioning to OTP memory
• Rollback counters
Non-Confidential © Arm 201823
Bootloader plans
PSA compliance:
• Anti-rollback protection
• Create interface between SPE and bootloaders
• Add support of multiple chains of trust and might be certificates
Explore possibilities to make BL2 updatable
Integrate crypto HW accelerator (CC312) with BL2
Non-Confidential © Arm 201824
How to get involved
TF-A and TF-M master codebases
• https://git.trustedfirmware.org/
TF-M Team @ Connect HKG18
• Abhishek Pandit
• Ashutosh Singh
• Tamas Ban
• Miklos Balint
Get in touch
• Come round LITE hacking room between 3-4 pm Wednesday
• Schedule a meeting via hkg18.pathable.com
More info on developer.arm.com
2525 Confidential © 2017 Arm Limited
Thank You!
Danke!
Merci!
谢谢!
ありがとう!
Gracias!
Kiitos!
감사합니다
धन्यवाद
Non-Confidential © Arm 201826
Supported platforms
MCUBoot with TF-M can run on:
• In simulator environment(FVP) on PC.
• MPS2 development board with AN521 (Castor) FPGA image
• MPS2 development board with AN519 (M23) FPGA image
• Musca_A porting is in progress
Non-Confidential © Arm 201827
Trailer(Swap status)
BL2 - Bootloader
Secure firmware
Non-secure firmware
Header
TLV(SHA, DS)
Secure firmware
Non-secure firmware
Header
TLV(SHA, DS)
SLOT_1
Placeholder for
new image
SLOT_0
Active image
Scratch area
Currently not updatable
0x0000...
0xXXXX...
Used during
image swapping
Non-Confidential © Arm 201828
BL2 - Bootloader
started
Erase
SLOT_1
Finalize aborted
swap
Initialize
phase
Authenticate
SW in SLOT_1
Swap images
between
SLOT_0
and
SLOT_1
Finalize image
status info
Pass execution
to SPE in
SLOT_0
CPU released
from reset
Is new
SW in
SLOT_1
Is there
aborted
swap?
yes
no
yes
Valid
SW?
no
no
Non-Confidential © Arm 201829
SPENSPE
Update
Client
Trusted
Update
Function
Firmware
Storage
Server
Runtime firmware
BL2 - Bootloader Slot_0 – Active Image Slot_1 – New imageLocal Storage
1. Download:
- firmware
- manifest
2.
Authentication:
- send manifest
Keys
NV counters
3. Provison new
image
4. Reboot
5. Authenticate
and swap images,
start image in slot_0
Remote server
Non-Confidential © Arm 201830
Old image
New image
Reboot
New image
Old image
Test NOK
New image
Old image
New image
Old image
Test OK Confirm
New image
Old image
Reboot
Old image
New image
Set
rollback

More Related Content

What's hot

HKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: IntroductionHKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: Introduction
Linaro
 
Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image
艾鍗科技
 

What's hot (20)

HKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: IntroductionHKG18-212 - Trusted Firmware M: Introduction
HKG18-212 - Trusted Firmware M: Introduction
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
 
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)
 
Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_
 
Linux on ARM 64-bit Architecture
Linux on ARM 64-bit ArchitectureLinux on ARM 64-bit Architecture
Linux on ARM 64-bit Architecture
 
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
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted Firmware
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development Training
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 

Similar to HKG18-223 - Trusted FirmwareM: Trusted boot

Windows 7 professional Vs Windows 7 enterprise
Windows 7 professional Vs Windows 7 enterpriseWindows 7 professional Vs Windows 7 enterprise
Windows 7 professional Vs Windows 7 enterprise
247infotech
 
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
The Linux Foundation
 
Thesis presentation
Thesis presentationThesis presentation
Thesis presentation
CHIACHE lee
 

Similar to HKG18-223 - Trusted FirmwareM: Trusted boot (20)

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
 
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
 
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
 
Windows 7 professional Vs Windows 7 enterprise
Windows 7 professional Vs Windows 7 enterpriseWindows 7 professional Vs Windows 7 enterprise
Windows 7 professional Vs Windows 7 enterprise
 
Top 10 secure boot mistakes
Top 10 secure boot mistakesTop 10 secure boot mistakes
Top 10 secure boot mistakes
 
CSF18 - GDPR - Sami Laiho
CSF18 - GDPR - Sami LaihoCSF18 - GDPR - Sami Laiho
CSF18 - GDPR - Sami Laiho
 
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
 
CSF18 - BitLocker Deep Dive - Sami Laiho
CSF18 - BitLocker Deep Dive - Sami LaihoCSF18 - BitLocker Deep Dive - Sami Laiho
CSF18 - BitLocker Deep Dive - Sami Laiho
 
Review of Hardware based solutions for trusted cloud computing.pptx
Review of Hardware based solutions for trusted cloud computing.pptxReview of Hardware based solutions for trusted cloud computing.pptx
Review of Hardware based solutions for trusted cloud computing.pptx
 
Easily emulating full systems on amazon fpg as
Easily emulating full systems on amazon fpg asEasily emulating full systems on amazon fpg as
Easily emulating full systems on amazon fpg as
 
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
 
TC and TPM.ppt
TC and TPM.pptTC and TPM.ppt
TC and TPM.ppt
 
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
 
U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0
 
eFolder Expert Series Webinar - BDR Do's and Dont's: Featuring Andrew Bensing...
eFolder Expert Series Webinar - BDR Do's and Dont's: Featuring Andrew Bensing...eFolder Expert Series Webinar - BDR Do's and Dont's: Featuring Andrew Bensing...
eFolder Expert Series Webinar - BDR Do's and Dont's: Featuring Andrew Bensing...
 
Managing bitlocker with MBAM
Managing bitlocker with MBAMManaging bitlocker with MBAM
Managing bitlocker with MBAM
 
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
 
Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018
 
Thesis presentation
Thesis presentationThesis presentation
Thesis presentation
 
Opening last bits of the infrastructure
Opening last bits of the infrastructureOpening last bits of the infrastructure
Opening last bits of the infrastructure
 

More from 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-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
Linaro
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready Program
Linaro
 

More from 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-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-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready Program
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

HKG18-223 - Trusted FirmwareM: Trusted boot

  • 1. Confidential © 2017 Arm Limited Trusted Firmware M Trusted Boot Tamas Ban Linaro 2018​ Arm
  • 2. Non-Confidential © Arm 20182 Agenda • Concept of trusted boot • Bootloader in TF-M • Firmware upgrade • Alternatives for upgrade • Alternatives for crypto • Plans • Q&A
  • 3. Non-Confidential © Arm 20183 What is trusted environment? An integrated execution environment(HW + SW) which can protect valuable assets against extraction: • Sensitive user data • Crypto keys • Firmware itself, etc. Hardware Trusted Env.
  • 4. Non-Confidential © Arm 20184 Introduction to trusted bootloader concept What? Why? How? SW whose aim is to verify the origin and integrity of other SW components which run on the target system. • Bootloader runs as soon as system is released from reset prior any other SW. In case of successful authentication it passes execution to the runtime firmware. One wants to ensure that only a certain set of SW, without any external modification, can run on a particular device. • Device contains sensitive assets which could be extracted with the usage of malicious SW. Device contains immutable SW and data, which can be used for authentication: • Integrity of SW: – Checking hash value • Origin of SW: – Checking digital signature
  • 5. Non-Confidential © Arm 20185 Considerations at selection of bootloader Secure boot requirements PSA spec defines boot and firmware update requirements: • Support for firmware upgrade • Support for chain-of-trust • Support for NIST or NSA approved cryptographic algorithm: SHA2, RSA, ECDSA, HMAC, KDF • Etc. Device constraints Device constraints mandate `yet-another` bootloader: • Usually less than 1 MB flash memory for code • Usually less than 256 KB RAM for data • Usage of cryptographic accelerator HW component • Computing power • No MMU, no memory virtualization • Power failure awareness • Etc.
  • 6. Non-Confidential © Arm 20186 Bootloader in TF-M MCUBoot is utilized to act as BL2 in TF-M: • Open source project with Apache 2.0 licensing • Low memory footprint; designed for 32 bit microcontrollers • Running from flash(currently XIP) • Several secure boot features are supported for firmware authentication: SHA256, RSA- 2048, (ECDSA) • Usage of 3rd party libraries for cryptographic operations: mbedTLS, (TinyCrypt) • Firmware update with image swapping • Power failure resistant upgrade • Fallback mechanism to stable version
  • 7. Non-Confidential © Arm 20187 First bootloader release MCUBoot integrated within TF-M repository: Customized to be OS agnostic Currently SHA256 and RSA-2048 are supported SPE and NSPE are concatenated to a single binary blob Hash and digital signature tooling and runtime check Software Upgrade prototype as proof of concept: • Emulating flash interface and behaviour over code SRAM System constraints: • No support for image size that does not fit in available RAM • CoT reduced to verify SPE and NSPE in the same go
  • 8. Non-Confidential © Arm 20188 Immutable BL1 code Chain of trust Hash BL2 image SIP/OEM Root of Trust Public Key (ROTPK) OEM/Developer Public Key(s) Use CA public key if supporting certificate revocation Check signature Public image signing keys can be rotated Check integrity NSPE image SPE image Check signature Public key Public key(s) Check signature
  • 9. Non-Confidential © Arm 20189 RTOS & Application Boot process Stage PSA (not mandatory) TF-M BL1 Immutable boot code in ROM Boot code in eFlash BL2 NSPESPE Secure runtime firmware Verify Load Start Core SPM Secure services TBD Verify Load Start Verify Load Start RTOS & Application BL2 MCUBoot Start Start Verify combined hash and signature
  • 10. Non-Confidential © Arm 201810 Basic operation and memory layout
  • 11. Non-Confidential © Arm 201811 6.) Copy scratch to Slot_0 3.) Erease Slot_1 Image swapping • Code linked to Slot_0 memory space • Divided into rounds • Scratch-sized data is moved in one go • Status info saved after each round • Power failure safe Slot_1_Sector_2 Slot_1_Sector_N Slot_1_Sector_3 Active image Slot_0 New image Slot_1 Slot_0_Sector_2 Slot_0_Sector_N Slot_0_Sector_3 Scratch area 1.) Erease scratch Sector_0 Sector_1 Slot_0_Sector_0 Slot_0_Sector_1 Slot_1_Sector_0 Slot_1_Sector_1 2.) Copy Slot_1 to scratch 4.) Copy Slot_1 to scratch 5.) Erease Slot_0 Slot_1_Sector_1 Slot_1_Sector_0 Save swap status info Slot_1_Sector_0 Slot_1_Sector_1 Slot_0_Sector_0 Slot_0_Sector_1 Slot_1_Sector_1 Slot_1_Sector_0
  • 12. Non-Confidential © Arm 201812 Firmware upgrade • Upgrade is a task of runtime FW • Potentially split between NSPE and SPE • XIP images
  • 13. Non-Confidential © Arm 201813 Image fallback • Store previous image • Health-check new image with BIST • Self confirmation • Reboot in case of failure • Revert back stable image • Set rollback after confirmation
  • 14. Non-Confidential © Arm 201814 Design constraints Header size - VTOR alignment: • Device dependent 512-1024 bytes Image slot’s layout must be aligned Scratch area size: • Flash memory wear-out • At least as the largest block size Real image size smaller than image slot: • Image header, TLV, swap status info, etc. No recovery option, if both images are faulty
  • 15. Non-Confidential © Arm 201815 Common threats Threat Mitigation Implemented Malicious firmware sent to device Signed firmware images Yes Downgrade to old vulnerable version Version or fallback counters check Not yet* Persistent malware(rootkits) Immutable boot code and data(BL1) Not yet Remote bricking of the device Backup image Yes Attacker gets signing key Key revocation support Not yet* *: Planned to be addressed in 2018
  • 16. Non-Confidential © Arm 201816 Alternatives to image swapping Position independent code Pros: • Reduced P/E cycle leads to longer lifetime • Reduced BL complexity and code footprint • Reduced boot-up time(no swapping) Cons: • Might lead bigger firmware code footprint • Some compiler switches are not compatible with PIC code • Some C lib (Microlib) cannot be compiled to be PIC • Other constraints when compiling code to be PIC Dual image build Pros: • Reduced P/E cycle leads to longer lifetime • Reduced BL complexity and code footprint • Reduced boot-up time(no swapping) Cons: • More complex build process • Extra logic in update client
  • 17. Non-Confidential © Arm 201817 Alternatives to image swapping Execute from RAM Pros: • Reduced P/E cycle leads to longer lifetime • Faster firmware execution • Reduced BL complexity and code footprint Cons: • Usually infeasible: less RAM than ROM Off-chip storage Pros: • Reduced P/E cycle leads to longer lifetime • Reduced BL complexity and code footprint Cons: • Might be a security risk: when to verify signature? • Might require image encryption, increased code footprint(include AES) and boot-up time
  • 18. Non-Confidential © Arm 201818 Alternatives to image swapping Overwrite Pros: • Reduced P/E cycle leads to longer lifetime • No need for scratch space • Reduced BL complexity and code footprint Cons: • Risk of bricking the device because no revert possible
  • 19. Non-Confidential © Arm 201819 MCUBoot as PIC code Experiment to compile PIC code: • RO and RW position independent( --ropi, --rwpi) • Vector table and IRQ handlers must be in RAM • IRQ handling unavailable until vectors and handlers relocated to RAM • Image size increased: • 29KB -> 38KB; More std. C lib was compiled-in • Limitations on source code: • Constant pointer cannot be used • CMSE armclang flag is not compatible with ROPI • Microlib cannot be compiled to be position independent
  • 20. Non-Confidential © Arm 201820 Comparison of crypto algorithms RSA • Big key size: up to 15KB • 128 bit level of security: RSA-3072 • ROM size(mbedTLS): ~14KB • RAM usage(mbedTLS): ~7KB • Key generation: slower • Signature generation: slower • Signature verification time: faster ECC • Small key size: up to 512 bits • 128 bit level of security: ECC-256 • ROM size(mbedTLS): • RAM usage(mbedTLS): ~13KB • Key generation: faster • Signature generation: faster • Signature verification : slower Moving from RSA to ECC
  • 21. Non-Confidential © Arm 201821 „Speed up asymmetric crypto” Signature verification with RSA or ECC is time consuming Symmetric crypto can spare clock cycles Replace asym. crypto with symmetric: HMAC, CMAC, etc: • Previously verified images(upgrade time) can get a MAC, generated based on Hardware Unique Key(HUK) • At boot time this MAC is verified instead of original signature • Boot time can be significantly reduced Download new firmware Verify signature Deploy in flash Generate MAC Save to flash Reset device Bootloader checks MAC
  • 22. Non-Confidential © Arm 201822 Alternatives for crypto libraries HW accelerator: • Improved performance / reduced code footprint CryptoCell-312: • Symmetric and asymmetric crypto • Runtime library: use mbedTLS API • Boot library: – Signature verification – X509 certificate parsing – Image verification and optional decryption • Asset provisioning to OTP memory • Rollback counters
  • 23. Non-Confidential © Arm 201823 Bootloader plans PSA compliance: • Anti-rollback protection • Create interface between SPE and bootloaders • Add support of multiple chains of trust and might be certificates Explore possibilities to make BL2 updatable Integrate crypto HW accelerator (CC312) with BL2
  • 24. Non-Confidential © Arm 201824 How to get involved TF-A and TF-M master codebases • https://git.trustedfirmware.org/ TF-M Team @ Connect HKG18 • Abhishek Pandit • Ashutosh Singh • Tamas Ban • Miklos Balint Get in touch • Come round LITE hacking room between 3-4 pm Wednesday • Schedule a meeting via hkg18.pathable.com More info on developer.arm.com
  • 25. 2525 Confidential © 2017 Arm Limited Thank You! Danke! Merci! 谢谢! ありがとう! Gracias! Kiitos! 감사합니다 धन्यवाद
  • 26. Non-Confidential © Arm 201826 Supported platforms MCUBoot with TF-M can run on: • In simulator environment(FVP) on PC. • MPS2 development board with AN521 (Castor) FPGA image • MPS2 development board with AN519 (M23) FPGA image • Musca_A porting is in progress
  • 27. Non-Confidential © Arm 201827 Trailer(Swap status) BL2 - Bootloader Secure firmware Non-secure firmware Header TLV(SHA, DS) Secure firmware Non-secure firmware Header TLV(SHA, DS) SLOT_1 Placeholder for new image SLOT_0 Active image Scratch area Currently not updatable 0x0000... 0xXXXX... Used during image swapping
  • 28. Non-Confidential © Arm 201828 BL2 - Bootloader started Erase SLOT_1 Finalize aborted swap Initialize phase Authenticate SW in SLOT_1 Swap images between SLOT_0 and SLOT_1 Finalize image status info Pass execution to SPE in SLOT_0 CPU released from reset Is new SW in SLOT_1 Is there aborted swap? yes no yes Valid SW? no no
  • 29. Non-Confidential © Arm 201829 SPENSPE Update Client Trusted Update Function Firmware Storage Server Runtime firmware BL2 - Bootloader Slot_0 – Active Image Slot_1 – New imageLocal Storage 1. Download: - firmware - manifest 2. Authentication: - send manifest Keys NV counters 3. Provison new image 4. Reboot 5. Authenticate and swap images, start image in slot_0 Remote server
  • 30. Non-Confidential © Arm 201830 Old image New image Reboot New image Old image Test NOK New image Old image New image Old image Test OK Confirm New image Old image Reboot Old image New image Set rollback

Editor's Notes

  1. Assumes a two stage bootloader Assumes Assumes certain kind of certificate chain, e.g. updating validation certificate for NSPE images requires updating BL2.