SlideShare ist ein Scribd-Unternehmen logo
1 von 26
1
Confidential
U-boot and Android Verified Boot 2.0
Igor Opaniuk
Embedded Career Day 2.0, Feb 10
2
Confidential
• Linux/Android Boot: generic approach
• Verified boot: what’s used for?
• AVB 2.0
- Generic overview
- AVB ops
- VBMeta structure/hashes and hashtrees
- Bootloader locked/unlocked states
- Rollback indexes
- Device boot states
- Role of the TEE and tamper-evident storage
• Links
Agenda
3
Confidential
Linux/Android Boot: generic approach
● ROM bootloader: pre-relocation initialization; boot from NAND flash, SD, MMC
● SPL (in a sake of overcoming platform limitations: SRAM is limited; watchdog, CPU
clocks/timers; zeros BSS memory; DMA); U-boot “pre-loader”
● U-boot: more sophisticated tasks: network boot(TFP/NFS), different FS, command
line
Falcon mode ?
4
Confidential
SPL: highlights
● arch_cpu_init()
○ initializes some registers, the watchdog, the DMA, etc;
● ccgr_init()
○ initializes CCGR registers in the CCM (Clock Controller Module);
● board_early_init_f()
○ initializes the M4 core and the pads of the UART1;
● timer_init()
○ initializes CPU timers and clock sources;
● preloader_console_init()
○ initializes serial port communications and prints the message "U-Boot SPL ...";
● spl_dram_init()
○ sets board-specific DRAM configuration (UDOO Neo Basic has 512MB of RAM
and different timings);
● memset() zeros BSS memory;
● board_init_r() continues the boot, loading the second stage of the boot-loader.
5
Confidential
U-boot->Linux kernel
6
Confidential
TI AM57xx boot
7
Confidential
HiKey boot: a bit different approach (UEFI/EDK2)
8
Confidential
Verified boot is the process of assuring the end user of the integrity of the software running on a
device.
Verified boot: generic info
9
Confidential
Verified boot is the process of assuring the end user of the integrity of the
software running on a device.
● Reduces risk of malware
○ we tampered with, for example, by a rootkit
● Denies rollback to previous versions of firmware (with possible security
issues, could be vulnerable to an exploit)
● Safe software updates
P.S. In most cases it does not mean the user needs to be locked out (fyi:
bootloader lock/unlock)
Verified boot: what’s for?
10
Confidential
Plays role in decisions related to enabling services as:
● DRM (Secure video playback etc.)
● Payments (Android Pay)
● Secure fingerprint/Secure input
● Secure storage
Verified boot: what’s for?
11
Confidential
● Root of trust (static): verification chain from ROM
bootloader
○ Initial code assumed to be trusted, holds keys for
later stages
● Every byte loaded should be verified before usage
● Upgradable firmware
● Rollback protection
Verified boot: basic requirements
12
Confidential
● TPM (Trusted Platform Module)/TrustZone
● Hashing
○ SHA256
● Public key crypto
Verified boot: technologies
13
Confidential
• “Recommended”(c) by Google support to be added by device
manufactures
• Integration with bootloaders:
- libavb/libavb_ab
• Portable to any system with C99 compiler
• avb/avbab ops should be implemented
• C library/runtime primitives
- avbtool for generation VBMeta
- Support in fastboot (bootloader “lock/unlock”; )
- Embedding root public key (key0)
- Tamper-evident storage
Android Verified Boot 2.0
14
Confidential
• .read_from_partition() - Reads N bytes from a partition identified by a string name
• .write_to_partition() - Writes N bytes to a partition identified by a string name
• .validate_vbmeta_public_key() - Checks if the given public key used to sign the ‘vbmeta’
partition is trusted
• .read_rollback_index() - Gets the rollback index for a given index location
• .write_rollback_index() - Sets the rollback index to a given location
• .read_is_device_unlocked() - Gets where the device is unlocked
• .get_unique_guid_for_partition() - Gets the GUID for a partition identified by a string name
Android Verified Boot 2.0: AVB ops
15
Confidential
VBMeta structure contains a number of descriptors (and other metadata) and all of this data is
cryptographically signed. Descriptors are used for image hashes, image hashtree metadata, and
so-called chained partitions.
Android Verified Boot 2.0: VBMeta structure
pic source: link (1)
16
Confidential
Android Verified Boot 2.0: hashtree
pic source: link (3)
17
Confidential
Android Verified Boot 2.0: chained partitions &
authority delegations
pic source: link (1)
18
Confidential
Rollback protection is having the device reject an image unless rollback_index[n] >=
stored_rollback_index[n] for all n, and having the device increase stored_rollback_index[n] over
time
Android Verified Boot 2.0: Rollback indexes
pic source: link (1)
19
Confidential
Android Verified Boot 2.0: A/B support
pic source: link (1)
20
Confidential
Android Verified Boot 2.0: avbtool
pic source: link (1)
21
Confidential
Unlocked state switch:
- Asserting physical presence of the user
- DRM/secure input are probably disabled
- Limited device guarantee
- Boot sequence changes
Locked/Unlocked states
22
Confidential
Android Verified Boot 2.0: device boot states and flow
● green: If in LOCKED state and the key used for verification was not set
by the end user.
● yellow: If in LOCKED state and the key used for verification was set by
the end user.
● orange: If in the UNLOCKED state.
23
Confidential
Android Verified Boot 2.0: device boot states
pic source: link (1)
24
Confidential
1) Bootloaders triggers TEE for
HMAC generation
2) TA generates HMAC based on
counter and private key
3) HMAC is sent to eMMC controller
4) eMMC controller reads the pre-
loaded key and the counter value to
generate HMAC
5) Compares two HMACs. If they
are identical, RPMB access is
allowed
Android Verified Boot 2.0: tamper-evident storage
25
Confidential
1. https://android.googlesource.com/platform/external/avb/+/master/README.md
2. https://www.denx.de/wiki/U-Boot
3. https://source.android.com/security/verifiedboot/dm-verity
4. http://github.com/OP-TEE
Links
26
Confidential
Thank you

Weitere ähnliche Inhalte

Was ist angesagt?

Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
Utkarsh Mankad
 
HKG18-402 - Build secure key management services in OP-TEE
HKG18-402 - Build secure key management services in OP-TEEHKG18-402 - Build secure key management services in OP-TEE
HKG18-402 - Build secure key management services in OP-TEE
Linaro
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Opersys inc.
 

Was ist angesagt? (20)

Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
How To Build Android for ARM Chip boards
How To Build Android for ARM Chip boardsHow To Build Android for ARM Chip boards
How To Build Android for ARM Chip boards
 
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
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
HKG18-203 - Overview of Linaro DRM
HKG18-203 - Overview of Linaro DRMHKG18-203 - Overview of Linaro DRM
HKG18-203 - Overview of Linaro DRM
 
강좌 07 ARM 프로세서용 아두이노
강좌 07 ARM 프로세서용 아두이노강좌 07 ARM 프로세서용 아두이노
강좌 07 ARM 프로세서용 아두이노
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
HKG18-402 - Build secure key management services in OP-TEE
HKG18-402 - Build secure key management services in OP-TEEHKG18-402 - Build secure key management services in OP-TEE
HKG18-402 - Build secure key management services in OP-TEE
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 

Ähnlich wie U-boot and Android Verified Boot 2.0

Hypervisor and VDI security
Hypervisor and VDI securityHypervisor and VDI security
Hypervisor and VDI security
Denis Gundarev
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
Linaro
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
Houcheng Lin
 
HKG18-116 - RAS Solutions for Arm64 Servers
HKG18-116 - RAS Solutions for Arm64 ServersHKG18-116 - RAS Solutions for Arm64 Servers
HKG18-116 - RAS Solutions for Arm64 Servers
Linaro
 
Andy Davis' Black Hat USA Presentation Revealing embedded fingerprints
Andy Davis' Black Hat USA Presentation Revealing embedded fingerprintsAndy Davis' Black Hat USA Presentation Revealing embedded fingerprints
Andy Davis' Black Hat USA Presentation Revealing embedded fingerprints
NCC Group
 

Ähnlich wie U-boot and Android Verified Boot 2.0 (20)

Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
HKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewHKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting Review
 
Android Attacks
Android AttacksAndroid Attacks
Android Attacks
 
Hypervisor and VDI security
Hypervisor and VDI securityHypervisor and VDI security
Hypervisor and VDI security
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hoodEmbedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Top 10 secure boot mistakes
Top 10 secure boot mistakesTop 10 secure boot mistakes
Top 10 secure boot mistakes
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
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
 
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
 
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-116 - RAS Solutions for Arm64 Servers
HKG18-116 - RAS Solutions for Arm64 ServersHKG18-116 - RAS Solutions for Arm64 Servers
HKG18-116 - RAS Solutions for Arm64 Servers
 
Andy Davis' Black Hat USA Presentation Revealing embedded fingerprints
Andy Davis' Black Hat USA Presentation Revealing embedded fingerprintsAndy Davis' Black Hat USA Presentation Revealing embedded fingerprints
Andy Davis' Black Hat USA Presentation Revealing embedded fingerprints
 
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
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 

Mehr von GlobalLogic Ukraine

GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Ukraine
 

Mehr von GlobalLogic Ukraine (20)

GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
GlobalLogic JavaScript Community Webinar #18 “Long Story Short: OSI Model”
 
Штучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptxШтучний інтелект як допомога в навчанні, а не замінник.pptx
Штучний інтелект як допомога в навчанні, а не замінник.pptx
 
Задачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptxЗадачі AI-розробника як застосовується штучний інтелект.pptx
Задачі AI-розробника як застосовується штучний інтелект.pptx
 
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptxЩо треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
Що треба вивчати, щоб стати розробником штучного інтелекту та нейромереж.pptx
 
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
GlobalLogic Java Community Webinar #16 “Zaloni’s Architecture for Data-Driven...
 
JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"JavaScript Community Webinar #14 "Why Is Git Rebase?"
JavaScript Community Webinar #14 "Why Is Git Rebase?"
 
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
 
Страх і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic EducationСтрах і сила помилок - IT Inside від GlobalLogic Education
Страх і сила помилок - IT Inside від GlobalLogic Education
 
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
GlobalLogic .NET Webinar #2 “Azure RBAC and Managed Identity”
 
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
 
“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?
 
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
GlobalLogic Machine Learning Webinar “Advanced Statistical Methods for Linear...
 
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
GlobalLogic Machine Learning Webinar “Statistical learning of linear regressi...
 
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
GlobalLogic C++ Webinar “The Minimum Knowledge to Become a C++ Developer”
 
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
Embedded Webinar #17 "Low-level Network Testing in Embedded Devices Development"
 
GlobalLogic Webinar "Introduction to Embedded QA"
GlobalLogic Webinar "Introduction to Embedded QA"GlobalLogic Webinar "Introduction to Embedded QA"
GlobalLogic Webinar "Introduction to Embedded QA"
 
C++ Webinar "Why Should You Learn C++ in 2021-22?"
C++ Webinar "Why Should You Learn C++ in 2021-22?"C++ Webinar "Why Should You Learn C++ in 2021-22?"
C++ Webinar "Why Should You Learn C++ in 2021-22?"
 
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
GlobalLogic Test Automation Live Testing Session “Android Behind UI — Testing...
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
 
GlobalLogic Azure TechTalk ONLINE “Marketing Data Lake in Azure”
GlobalLogic Azure TechTalk ONLINE “Marketing Data Lake in Azure”GlobalLogic Azure TechTalk ONLINE “Marketing Data Lake in Azure”
GlobalLogic Azure TechTalk ONLINE “Marketing Data Lake in Azure”
 

Kürzlich hochgeladen

result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Kürzlich hochgeladen (20)

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

U-boot and Android Verified Boot 2.0

  • 1. 1 Confidential U-boot and Android Verified Boot 2.0 Igor Opaniuk Embedded Career Day 2.0, Feb 10
  • 2. 2 Confidential • Linux/Android Boot: generic approach • Verified boot: what’s used for? • AVB 2.0 - Generic overview - AVB ops - VBMeta structure/hashes and hashtrees - Bootloader locked/unlocked states - Rollback indexes - Device boot states - Role of the TEE and tamper-evident storage • Links Agenda
  • 3. 3 Confidential Linux/Android Boot: generic approach ● ROM bootloader: pre-relocation initialization; boot from NAND flash, SD, MMC ● SPL (in a sake of overcoming platform limitations: SRAM is limited; watchdog, CPU clocks/timers; zeros BSS memory; DMA); U-boot “pre-loader” ● U-boot: more sophisticated tasks: network boot(TFP/NFS), different FS, command line Falcon mode ?
  • 4. 4 Confidential SPL: highlights ● arch_cpu_init() ○ initializes some registers, the watchdog, the DMA, etc; ● ccgr_init() ○ initializes CCGR registers in the CCM (Clock Controller Module); ● board_early_init_f() ○ initializes the M4 core and the pads of the UART1; ● timer_init() ○ initializes CPU timers and clock sources; ● preloader_console_init() ○ initializes serial port communications and prints the message "U-Boot SPL ..."; ● spl_dram_init() ○ sets board-specific DRAM configuration (UDOO Neo Basic has 512MB of RAM and different timings); ● memset() zeros BSS memory; ● board_init_r() continues the boot, loading the second stage of the boot-loader.
  • 7. 7 Confidential HiKey boot: a bit different approach (UEFI/EDK2)
  • 8. 8 Confidential Verified boot is the process of assuring the end user of the integrity of the software running on a device. Verified boot: generic info
  • 9. 9 Confidential Verified boot is the process of assuring the end user of the integrity of the software running on a device. ● Reduces risk of malware ○ we tampered with, for example, by a rootkit ● Denies rollback to previous versions of firmware (with possible security issues, could be vulnerable to an exploit) ● Safe software updates P.S. In most cases it does not mean the user needs to be locked out (fyi: bootloader lock/unlock) Verified boot: what’s for?
  • 10. 10 Confidential Plays role in decisions related to enabling services as: ● DRM (Secure video playback etc.) ● Payments (Android Pay) ● Secure fingerprint/Secure input ● Secure storage Verified boot: what’s for?
  • 11. 11 Confidential ● Root of trust (static): verification chain from ROM bootloader ○ Initial code assumed to be trusted, holds keys for later stages ● Every byte loaded should be verified before usage ● Upgradable firmware ● Rollback protection Verified boot: basic requirements
  • 12. 12 Confidential ● TPM (Trusted Platform Module)/TrustZone ● Hashing ○ SHA256 ● Public key crypto Verified boot: technologies
  • 13. 13 Confidential • “Recommended”(c) by Google support to be added by device manufactures • Integration with bootloaders: - libavb/libavb_ab • Portable to any system with C99 compiler • avb/avbab ops should be implemented • C library/runtime primitives - avbtool for generation VBMeta - Support in fastboot (bootloader “lock/unlock”; ) - Embedding root public key (key0) - Tamper-evident storage Android Verified Boot 2.0
  • 14. 14 Confidential • .read_from_partition() - Reads N bytes from a partition identified by a string name • .write_to_partition() - Writes N bytes to a partition identified by a string name • .validate_vbmeta_public_key() - Checks if the given public key used to sign the ‘vbmeta’ partition is trusted • .read_rollback_index() - Gets the rollback index for a given index location • .write_rollback_index() - Sets the rollback index to a given location • .read_is_device_unlocked() - Gets where the device is unlocked • .get_unique_guid_for_partition() - Gets the GUID for a partition identified by a string name Android Verified Boot 2.0: AVB ops
  • 15. 15 Confidential VBMeta structure contains a number of descriptors (and other metadata) and all of this data is cryptographically signed. Descriptors are used for image hashes, image hashtree metadata, and so-called chained partitions. Android Verified Boot 2.0: VBMeta structure pic source: link (1)
  • 16. 16 Confidential Android Verified Boot 2.0: hashtree pic source: link (3)
  • 17. 17 Confidential Android Verified Boot 2.0: chained partitions & authority delegations pic source: link (1)
  • 18. 18 Confidential Rollback protection is having the device reject an image unless rollback_index[n] >= stored_rollback_index[n] for all n, and having the device increase stored_rollback_index[n] over time Android Verified Boot 2.0: Rollback indexes pic source: link (1)
  • 19. 19 Confidential Android Verified Boot 2.0: A/B support pic source: link (1)
  • 20. 20 Confidential Android Verified Boot 2.0: avbtool pic source: link (1)
  • 21. 21 Confidential Unlocked state switch: - Asserting physical presence of the user - DRM/secure input are probably disabled - Limited device guarantee - Boot sequence changes Locked/Unlocked states
  • 22. 22 Confidential Android Verified Boot 2.0: device boot states and flow ● green: If in LOCKED state and the key used for verification was not set by the end user. ● yellow: If in LOCKED state and the key used for verification was set by the end user. ● orange: If in the UNLOCKED state.
  • 23. 23 Confidential Android Verified Boot 2.0: device boot states pic source: link (1)
  • 24. 24 Confidential 1) Bootloaders triggers TEE for HMAC generation 2) TA generates HMAC based on counter and private key 3) HMAC is sent to eMMC controller 4) eMMC controller reads the pre- loaded key and the counter value to generate HMAC 5) Compares two HMACs. If they are identical, RPMB access is allowed Android Verified Boot 2.0: tamper-evident storage
  • 25. 25 Confidential 1. https://android.googlesource.com/platform/external/avb/+/master/README.md 2. https://www.denx.de/wiki/U-Boot 3. https://source.android.com/security/verifiedboot/dm-verity 4. http://github.com/OP-TEE Links