SlideShare a Scribd company logo
1 of 18
Download to read offline
BITS and CHIPSEC as coreboot payloads
OSFC 2018
Piotr Król and Michał Żygowski
1 / 18
Introduction
Motivation
BITS features
CHIPSEC features
Enabling BITS as payload
Enabling CHIPSEC as payload
BITS and CHIPSEC in action (demo)
Summary
Agenda
2 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
Piotr Król Michał Żygowski
Founder & Embedded Systems
Consultant
Firmware Engineer
michal.zygowski@3mdeb.com
linkedin.com/in/michał-żygowski-
88954416b
@pietrushnic
piotr.krol@3mdeb.com
linkedin.com/in/krolpiotr
facebook.com/piotr.krol.756859
Introduction
3 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
How we validate quality of our firmware?
Not enough validation in open source firmware
Firmware security is about validation and formal development process
BITS and CHIPSEC are recognized frameworks for quality checks
Linux UEFI Validation (LUV), what about coreboot?
Certification issues
Motivation
4 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
OS is external firmware customer
firmware is treated as part of hardware and should work out of the box
OS may introduce another point of failures
In following presentation we would like to present our achievements while using
BITS and CHIPSEC as validation payloads for MinnowBoard Turbot.
http://blog.qatestlab.com/wp-content/uploads/2011/02/validation.jpg
Why we should avoid running tests in OS?
5 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
system tables
ACPI
SMBIOS
MultiProcessor tables
$PIR (PCI Interrupt Routing) table
Runtime and Boot Services (Tianocore payload)
any other structure that firmware present to OS
hardware configuration
SPI protection
SMRAM protection
other
spectre mitigation presence
vendor specific features (USB DCI, ME, PSP)
What we should test?
6 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
BITS (BIOS Implementation Test Suite) consist of a GRUB2 bootloader
extended with runtime Python support.
Consist of Python scripts that validate:
ACPI
SMRR configuration
SMI latency
MP Table
MSRs
Typically it is run using bootable USB created using BITS ISO image
Can be run through GRUB menu entries or using batch mode
Results can be read directly on screen or saved to filesystem
Extensibility: Python interpreter in GRUB2
BITS intro
7 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
BITS is quite big in size 45MB - not suitable for SPI flash
was solved by utilizing only core (GRUB2+Python)
Environment is not user friendly - each modification requires SPI reflashing
network boot or using USB for development can solve that
live Python usage
Build system has real problems since it depends on obsolete libraries
we used Docker container for compilation
http://clipground.com/images/constraint-clipart-1.jpg
Constraints
8 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
checks SPI and firmware
protection
verifies integrity of flash descriptor
tests SMM, SMIs and SMM cache
poisoning
checks MSRs, SMRRs and memory
configuration
other various tools:
NMI sending
IOMMU check
TPM, EC utility
CMOS, PCI, SPD utility
etc.
CHIPSEC features
9 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
utilize GRUB from coreboot - already suitable for SPI flash
re-add couple functions required by BITS
grub_strcat
disable support for software floating point arithmetics using
compiler flags
small fixes to printf arguments parsing
port Python support for GRUB
adjust build system
hack BITS to correctly handle paths in SPI flash
isdir hack
enable serial output in toplevel config
LZMA compression
Enabling BITS as payload
10 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
add Python source code to BITS
resolve dependency from Python standard library
BITS has different needs than CHIPSEC
add missing Python standard libraries (xml, JSON, subprocess,
distutils...)
Implement BITS OS helper
Use some methods from BITS as backend for CHIPSEC calls
Enabling CHIPSEC as payload
11 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
Initial size of USB image - 45MB
Cutting off not needed pieces: 12.6MB
UEFI support
LZMA compression: 3.6MB
Solving size issue
12 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
FMAP REGION: COREBOOT
Name Offset Type Size Comp
cbfs master header 0x0 cbfs header 32 none
fallback/romstage 0x80 stage 31372 none
cpu_microcode_blob.bin 0x7b80 microcode 104448 none
fallback/ramstage 0x21400 stage 61533 none
config 0x304c0 raw 669 none
revision 0x307c0 raw 582 none
cmos_layout.bin 0x30a40 cmos_layout 1208 none
fallback/dsdt.aml 0x30f40 raw 12528 none
fallback/payload 0x34080 simple elf 3643338 none <--- HERE
(empty) 0x3ad8c0 null 74968 none
fsp.bin 0x3bfdc0 fsp 229376 none
(empty) 0x3f7e00 null 30936 none
bootblock 0x3ff700 bootblock 1720 none
BITS and CHIPSEC in CBFS
13 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
BITS and CHIPSEC in GRUB
14 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
BITS and CHIPSEC demo
15 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
[CHIPSEC] *************************** SUMMARY ***************************
[CHIPSEC] Time elapsed 2.762
[CHIPSEC] Modules total 17
[CHIPSEC] Modules failed to run 0:
[CHIPSEC] Modules passed 4:
[+] PASSED: chipsec.modules.common.spi_fdopss
[+] PASSED: chipsec.modules.common.bios_ts
[+] PASSED: chipsec.modules.common.bios_kbrd_buffer
[+] PASSED: chipsec.modules.common.smrr
[CHIPSEC] Modules information 0:
[CHIPSEC] Modules failed 5:
[-] FAILED: chipsec.modules.common.memlock
[-] FAILED: chipsec.modules.common.bios_wp
[-] FAILED: chipsec.modules.common.spi_access
[-] FAILED: chipsec.modules.common.spi_desc
[-] FAILED: chipsec.modules.common.spi_lock
[CHIPSEC] Modules with warnings 0:
[CHIPSEC] Modules not implemented 8:
[*] NOT IMPLEMENTED: chipsec.modules.common.ia32cfg
[*] NOT IMPLEMENTED: chipsec.modules.common.bios_smi
[*] NOT IMPLEMENTED: chipsec.modules.common.smm
[*] NOT IMPLEMENTED: chipsec.modules.common.rtclock
[*] NOT IMPLEMENTED: chipsec.modules.memconfig
[*] NOT IMPLEMENTED: chipsec.modules.remap
[*] NOT IMPLEMENTED: chipsec.modules.smm_dma
[*] NOT IMPLEMENTED: chipsec.modules.debugenabled
[CHIPSEC] Modules not applicable 0:
[CHIPSEC] *****************************************************************
Results
16 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
Bare metal (Micro)Python support is important for firmware validation
There is not enough validation in firmware
We should utilize existing tools that were proved in industry
Further steps
Mainlining process
Consider BITS and CHIPSEC port to MicroPython
Fix platform bugs and misconfiguration
Summary
17 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski
Q&A
18 / 18
OSFC 2018
CC BY 4.0 | Piotr Król and Michał Żygowski

More Related Content

Similar to BITS and CHIPSEC as Coreboot Payloads for Firmware Validation

Lightning talks - Qubes OS and 3mdeb "minisummit" 2019
Lightning talks - Qubes OS and 3mdeb "minisummit" 2019Lightning talks - Qubes OS and 3mdeb "minisummit" 2019
Lightning talks - Qubes OS and 3mdeb "minisummit" 2019Piotr Król
 
Advanced Evasion Techniques by Win32/Gapz
Advanced Evasion Techniques by Win32/GapzAdvanced Evasion Techniques by Win32/Gapz
Advanced Evasion Techniques by Win32/GapzAlex Matrosov
 
ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!Affan Syed
 
Building a Remote Control Robot with Automotive Grade Linux
Building a Remote Control Robot with Automotive Grade LinuxBuilding a Remote Control Robot with Automotive Grade Linux
Building a Remote Control Robot with Automotive Grade LinuxLeon Anavi
 
Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedBrendan Gregg
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul IroftiMaking OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul Iroftieurobsdcon
 
NetConf 2018 BPF Observability
NetConf 2018 BPF ObservabilityNetConf 2018 BPF Observability
NetConf 2018 BPF ObservabilityBrendan Gregg
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220AndrewWright224
 
Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Bo...
Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Bo...Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Bo...
Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Bo...ryancox
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadAndrewWright224
 
Enabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devicesEnabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devicesPiotr Król
 
Micropython for the iot
Micropython for the iotMicropython for the iot
Micropython for the iotJacques Supcik
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Projectrossburton
 
Investigation report on 64 bit support and some of new features in aosp master
Investigation report on 64 bit support and some of new features in aosp masterInvestigation report on 64 bit support and some of new features in aosp master
Investigation report on 64 bit support and some of new features in aosp masterhidenorly
 
Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...
Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...
Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...Yoshitake Kobayashi
 

Similar to BITS and CHIPSEC as Coreboot Payloads for Firmware Validation (20)

Lightning talks - Qubes OS and 3mdeb "minisummit" 2019
Lightning talks - Qubes OS and 3mdeb "minisummit" 2019Lightning talks - Qubes OS and 3mdeb "minisummit" 2019
Lightning talks - Qubes OS and 3mdeb "minisummit" 2019
 
Advanced Evasion Techniques by Win32/Gapz
Advanced Evasion Techniques by Win32/GapzAdvanced Evasion Techniques by Win32/Gapz
Advanced Evasion Techniques by Win32/Gapz
 
ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!
 
Building a Remote Control Robot with Automotive Grade Linux
Building a Remote Control Robot with Automotive Grade LinuxBuilding a Remote Control Robot with Automotive Grade Linux
Building a Remote Control Robot with Automotive Grade Linux
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
Systems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting StartedSystems@Scale 2021 BPF Performance Getting Started
Systems@Scale 2021 BPF Performance Getting Started
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Readme
ReadmeReadme
Readme
 
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul IroftiMaking OpenBSD Useful on the Octeon Network Gear by Paul Irofti
Making OpenBSD Useful on the Octeon Network Gear by Paul Irofti
 
NetConf 2018 BPF Observability
NetConf 2018 BPF ObservabilityNetConf 2018 BPF Observability
NetConf 2018 BPF Observability
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220
 
Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Bo...
Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Bo...Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Bo...
Developing Applications for Beagle Bone Black, Raspberry Pi and SoC Single Bo...
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPad
 
Enabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devicesEnabling TPM 2.0 on coreboot based devices
Enabling TPM 2.0 on coreboot based devices
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Micropython for the iot
Micropython for the iotMicropython for the iot
Micropython for the iot
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Project
 
Investigation report on 64 bit support and some of new features in aosp master
Investigation report on 64 bit support and some of new features in aosp masterInvestigation report on 64 bit support and some of new features in aosp master
Investigation report on 64 bit support and some of new features in aosp master
 
Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...
Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...
Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...
 

More from Piotr Król

D-RTM for Qubes OS VMs
D-RTM for Qubes OS VMsD-RTM for Qubes OS VMs
D-RTM for Qubes OS VMsPiotr Król
 
S-RTM for Qubes OS VMs
S-RTM for Qubes OS VMsS-RTM for Qubes OS VMs
S-RTM for Qubes OS VMsPiotr Król
 
Qubes hardware certification
Qubes hardware certificationQubes hardware certification
Qubes hardware certificationPiotr Król
 
Qubes OS and TPM 2.0
Qubes OS and TPM 2.0Qubes OS and TPM 2.0
Qubes OS and TPM 2.0Piotr Król
 
Status of AEM for Intel and AMD
Status of AEM for Intel and AMDStatus of AEM for Intel and AMD
Status of AEM for Intel and AMDPiotr Król
 
RTE v1.0.0 specification
RTE v1.0.0 specificationRTE v1.0.0 specification
RTE v1.0.0 specificationPiotr Król
 
Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"
Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"
Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"Piotr Król
 
How to build IoT solution using cloud infrastructure?
How to build IoT solution using cloud infrastructure?How to build IoT solution using cloud infrastructure?
How to build IoT solution using cloud infrastructure?Piotr Król
 

More from Piotr Król (8)

D-RTM for Qubes OS VMs
D-RTM for Qubes OS VMsD-RTM for Qubes OS VMs
D-RTM for Qubes OS VMs
 
S-RTM for Qubes OS VMs
S-RTM for Qubes OS VMsS-RTM for Qubes OS VMs
S-RTM for Qubes OS VMs
 
Qubes hardware certification
Qubes hardware certificationQubes hardware certification
Qubes hardware certification
 
Qubes OS and TPM 2.0
Qubes OS and TPM 2.0Qubes OS and TPM 2.0
Qubes OS and TPM 2.0
 
Status of AEM for Intel and AMD
Status of AEM for Intel and AMDStatus of AEM for Intel and AMD
Status of AEM for Intel and AMD
 
RTE v1.0.0 specification
RTE v1.0.0 specificationRTE v1.0.0 specification
RTE v1.0.0 specification
 
Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"
Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"
Booting UEFI-aware OS on coreboot enabled platform - "In God's Name, Why?"
 
How to build IoT solution using cloud infrastructure?
How to build IoT solution using cloud infrastructure?How to build IoT solution using cloud infrastructure?
How to build IoT solution using cloud infrastructure?
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

BITS and CHIPSEC as Coreboot Payloads for Firmware Validation

  • 1. BITS and CHIPSEC as coreboot payloads OSFC 2018 Piotr Król and Michał Żygowski 1 / 18
  • 2. Introduction Motivation BITS features CHIPSEC features Enabling BITS as payload Enabling CHIPSEC as payload BITS and CHIPSEC in action (demo) Summary Agenda 2 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 3. Piotr Król Michał Żygowski Founder & Embedded Systems Consultant Firmware Engineer michal.zygowski@3mdeb.com linkedin.com/in/michał-żygowski- 88954416b @pietrushnic piotr.krol@3mdeb.com linkedin.com/in/krolpiotr facebook.com/piotr.krol.756859 Introduction 3 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 4. How we validate quality of our firmware? Not enough validation in open source firmware Firmware security is about validation and formal development process BITS and CHIPSEC are recognized frameworks for quality checks Linux UEFI Validation (LUV), what about coreboot? Certification issues Motivation 4 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 5. OS is external firmware customer firmware is treated as part of hardware and should work out of the box OS may introduce another point of failures In following presentation we would like to present our achievements while using BITS and CHIPSEC as validation payloads for MinnowBoard Turbot. http://blog.qatestlab.com/wp-content/uploads/2011/02/validation.jpg Why we should avoid running tests in OS? 5 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 6. system tables ACPI SMBIOS MultiProcessor tables $PIR (PCI Interrupt Routing) table Runtime and Boot Services (Tianocore payload) any other structure that firmware present to OS hardware configuration SPI protection SMRAM protection other spectre mitigation presence vendor specific features (USB DCI, ME, PSP) What we should test? 6 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 7. BITS (BIOS Implementation Test Suite) consist of a GRUB2 bootloader extended with runtime Python support. Consist of Python scripts that validate: ACPI SMRR configuration SMI latency MP Table MSRs Typically it is run using bootable USB created using BITS ISO image Can be run through GRUB menu entries or using batch mode Results can be read directly on screen or saved to filesystem Extensibility: Python interpreter in GRUB2 BITS intro 7 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 8. BITS is quite big in size 45MB - not suitable for SPI flash was solved by utilizing only core (GRUB2+Python) Environment is not user friendly - each modification requires SPI reflashing network boot or using USB for development can solve that live Python usage Build system has real problems since it depends on obsolete libraries we used Docker container for compilation http://clipground.com/images/constraint-clipart-1.jpg Constraints 8 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 9. checks SPI and firmware protection verifies integrity of flash descriptor tests SMM, SMIs and SMM cache poisoning checks MSRs, SMRRs and memory configuration other various tools: NMI sending IOMMU check TPM, EC utility CMOS, PCI, SPD utility etc. CHIPSEC features 9 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 10. utilize GRUB from coreboot - already suitable for SPI flash re-add couple functions required by BITS grub_strcat disable support for software floating point arithmetics using compiler flags small fixes to printf arguments parsing port Python support for GRUB adjust build system hack BITS to correctly handle paths in SPI flash isdir hack enable serial output in toplevel config LZMA compression Enabling BITS as payload 10 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 11. add Python source code to BITS resolve dependency from Python standard library BITS has different needs than CHIPSEC add missing Python standard libraries (xml, JSON, subprocess, distutils...) Implement BITS OS helper Use some methods from BITS as backend for CHIPSEC calls Enabling CHIPSEC as payload 11 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 12. Initial size of USB image - 45MB Cutting off not needed pieces: 12.6MB UEFI support LZMA compression: 3.6MB Solving size issue 12 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 13. FMAP REGION: COREBOOT Name Offset Type Size Comp cbfs master header 0x0 cbfs header 32 none fallback/romstage 0x80 stage 31372 none cpu_microcode_blob.bin 0x7b80 microcode 104448 none fallback/ramstage 0x21400 stage 61533 none config 0x304c0 raw 669 none revision 0x307c0 raw 582 none cmos_layout.bin 0x30a40 cmos_layout 1208 none fallback/dsdt.aml 0x30f40 raw 12528 none fallback/payload 0x34080 simple elf 3643338 none <--- HERE (empty) 0x3ad8c0 null 74968 none fsp.bin 0x3bfdc0 fsp 229376 none (empty) 0x3f7e00 null 30936 none bootblock 0x3ff700 bootblock 1720 none BITS and CHIPSEC in CBFS 13 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 14. BITS and CHIPSEC in GRUB 14 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 15. BITS and CHIPSEC demo 15 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 16. [CHIPSEC] *************************** SUMMARY *************************** [CHIPSEC] Time elapsed 2.762 [CHIPSEC] Modules total 17 [CHIPSEC] Modules failed to run 0: [CHIPSEC] Modules passed 4: [+] PASSED: chipsec.modules.common.spi_fdopss [+] PASSED: chipsec.modules.common.bios_ts [+] PASSED: chipsec.modules.common.bios_kbrd_buffer [+] PASSED: chipsec.modules.common.smrr [CHIPSEC] Modules information 0: [CHIPSEC] Modules failed 5: [-] FAILED: chipsec.modules.common.memlock [-] FAILED: chipsec.modules.common.bios_wp [-] FAILED: chipsec.modules.common.spi_access [-] FAILED: chipsec.modules.common.spi_desc [-] FAILED: chipsec.modules.common.spi_lock [CHIPSEC] Modules with warnings 0: [CHIPSEC] Modules not implemented 8: [*] NOT IMPLEMENTED: chipsec.modules.common.ia32cfg [*] NOT IMPLEMENTED: chipsec.modules.common.bios_smi [*] NOT IMPLEMENTED: chipsec.modules.common.smm [*] NOT IMPLEMENTED: chipsec.modules.common.rtclock [*] NOT IMPLEMENTED: chipsec.modules.memconfig [*] NOT IMPLEMENTED: chipsec.modules.remap [*] NOT IMPLEMENTED: chipsec.modules.smm_dma [*] NOT IMPLEMENTED: chipsec.modules.debugenabled [CHIPSEC] Modules not applicable 0: [CHIPSEC] ***************************************************************** Results 16 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 17. Bare metal (Micro)Python support is important for firmware validation There is not enough validation in firmware We should utilize existing tools that were proved in industry Further steps Mainlining process Consider BITS and CHIPSEC port to MicroPython Fix platform bugs and misconfiguration Summary 17 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski
  • 18. Q&A 18 / 18 OSFC 2018 CC BY 4.0 | Piotr Król and Michał Żygowski