SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
LibreOffice oss-fuzz,
crashtesting, coverity
Overview
• Oss-Fuzz
• Crashtesting
• Coverity
Oss-Fuzz
Overview
● Continuous Fuzzing of our import filters
● Thanks to Google we get to use their infrastructure and resources
Configuration
● Build remotely on google’s side
– Calls our bin/oss-fuzz-build.sh
● 45 fuzzer targets in vcl/workben
● Each one is built with
– libfuzzer + asan
– libfuzzer + ubsan
– afl + asan
– honggfuzz + asan
=> 180 total
Configuration
● No dynamic libraries allowed
– A serious pain for us
– distro-configs/LibreOfficeOssFuzz.conf
– Reuse --disable-dynamic-loading intended for iOS
– Individual fuzzers are unfortunately v. large
● Run without config layer
– Hardcoded suitable default for –enable-fuzzers
– utl::ConfigManager::IsAvoidConfig()
● https://dev-www.libreoffice.org/corpus/
– Contains our seed corpuses for 60 file formats
– 15 are dtardons and co’s dlplib filters and are fuzzed separately
Oss-Fuzz Reports per Year
• Over 1100 issues over four years
2017 2018 2019 2020
0
50
100
150
200
250
300
350
400
450
500
oss-fuzz: Last 4 Years
Projected
Filed
Year
Reports
• More than one a day in 2017 and 2018
• 113 this year to date, estimate 142 by end of year
• This years uptick due to a new route from sftfuzzer into old untested code
What a report looks like
Auto minimize
Sample ubsan bug
● Buggy change, the unsigned
short is promoted to int,
undefined behavior in
addition
● Change back to a larger
unsigned type
Timeouts
● Sometimes timeout is genuine infinite loop
– More often it’s just slow
● OssFuzz will report a maximum of one timeout per fuzzer
● Fix a timeout, another typically gets reported soon after
● Limit input size with a .options files
[libfuzzer]
max_len = 65536
● Some file formats have ~infinite decompression support
– Tiny input can legitimately provide mega data to process
– Examine FUZZ_MAX_INPUT_LEN (from .options) at runtime and limit to
some factor of that
OOM
● Limit memory usage with
setenv("JPEGMEM", "768M", 1);
setenv("SC_MAX_MATRIX_ELEMENTS", "60000000", 1);
setenv("SC_NO_THREADED_CALCULATION", "1", 1);
● Pre-allocating buffers depending on potentially lying headers
– Often a known relationship between remaining length of the file and the
amount of data that it can produce
– So short reads can be predicted before buffer allocation
● GIF’s have a max compression of ~1:2560,
Current Open Bugs
● 10 open bugs
– All Timeouts
CrashTesting
Overview
● Document Corpus
– Most scraped out of various bugzilla instances with
get-bugzilla-attachments-by-mimetype
– 116,200 files
● Import them all
– With Markus Mohrhard’s test-bugzilla-files
● For many formats, then export to multiple formats
● Reimport exported output
● Report failed imports/exports
● Backtraces extracted from coredumps
New Setup
● New Hardware this year
– Next day results
– Vs ~3 days with old setup
● Thanks to Adfinis
12 Months of Importing
● Persistent <10 cluster of failures
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73
0
10
20
30
40
50
60
70
Import Failures
Import
Build
Failures
12 Months of Exporting
● Large jumps as regressions detected and fixed
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73
0
50
100
150
200
250
300
Export Failures
Export
Build
Failures
Coverity
Configuration
● Build locally with coverity’s tooling
● Outputs a big blob which we upload to their server which does
the analysis
● https://scan.coverity.com/projects/libreoffice
● Project settings are open, no need to apply to be a “member” to
see the findings
● Contemporary coverity scans both C++ and Java
● Coverity currently supports C++17, but not C++2a
– patch configure.ac to not try c++2a for the coverity run
● We only scan LibreOffice, not dependencies
– distro-configs/LibreOfficeCoverity.conf
– So no ignored “external” category anymore
Example warning
● uninit_member
– If a class initializes none of its members in its ctors there is no warning as
its assumed to be intentional
– If it initializes most of them, it warns about the uninitialized ones
– A common mistake is with a class with multiple ctors, new member gets
added and initialized in one ctor but not the other
warning type
Pattern for waiving warnings
● An issue can be marked as a false positive or intentional in the web UI
– But that only affects that coverity instance. Red Hat runs another one f.e.
– If the code changes enough coverity will loose the ability to detect its the same code
and reissue the warning
● INTENTIONAL pattern
– // coverity[WARNING] - OPTIONAL_COMMENT
– WARNING is the text before the : in the report
–
–
–
● FALSE POSITIVE pattern
– // coverity[WARNING : FALSE] - OPTIONAL_COMMENT
Pattern to indicate program exit
● // coverity[+kill] indicates that the annotated function is intended to
kill the program
–
–
–
● We use this in cppunit to indicate that that Asserter::fail is intended
to exit the program. In reality it throws a deliberately unhandled
exception which would be warned about otherwise
● Note that –enable-assert-always-abort is active for our coverity
builds so failing asserts terminate program flow so coverity warnings
about “impossible” situations are resolvable by adding appropriate
asserts
Tainted data
● Coverity detects common byteswapping techniques as indicating
that data is probably untrusted tainted data
● Very helpful for our general file format parsing, but not for our own
legacy registry data format
● __coverity_tainted_data_sanitize__ can be used to sanitize the data
Tainted data
● Validating untrusted data
– A simple sanity test of tainted example
Outstanding vs Fixed defects
Gap between
requiring C++17
and coverity support
Coverity Stats 2020

Más contenido relacionado

La actualidad más candente

Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easyKim Chee Leong
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
 
CRaSH the shell for the JVM
CRaSH the shell for the JVMCRaSH the shell for the JVM
CRaSH the shell for the JVMjviet
 
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...Ontico
 
Rex - Lightning Talk yapc.eu 2013
Rex - Lightning Talk yapc.eu 2013Rex - Lightning Talk yapc.eu 2013
Rex - Lightning Talk yapc.eu 2013Jan Gehring
 
Newgenlib Installation on Ubuntu 12.04
Newgenlib Installation on Ubuntu 12.04Newgenlib Installation on Ubuntu 12.04
Newgenlib Installation on Ubuntu 12.04Rajendra Singh
 
nginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottlenginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottleJordi Soucheiron
 
Multiple django applications on a single server with nginx
Multiple django applications on a single server with nginxMultiple django applications on a single server with nginx
Multiple django applications on a single server with nginxroskakori
 
Integrating the Ruby Debugger into YaST
Integrating the Ruby Debugger into YaSTIntegrating the Ruby Debugger into YaST
Integrating the Ruby Debugger into YaSTlslezak
 
CIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterCIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterAndrii Podanenko
 
Владимир Перепелица "Модули"
Владимир Перепелица "Модули"Владимир Перепелица "Модули"
Владимир Перепелица "Модули"Media Gorod
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & moreJacqueline Kazil
 
20151229 wnmp & phalcon micro app - part I
20151229 wnmp & phalcon micro app - part I20151229 wnmp & phalcon micro app - part I
20151229 wnmp & phalcon micro app - part ITaien Wang
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...ScaleGrid.io
 

La actualidad más candente (19)

Gcc opt
Gcc optGcc opt
Gcc opt
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 
Vagrant and CentOS 7
Vagrant and CentOS 7Vagrant and CentOS 7
Vagrant and CentOS 7
 
CRaSH the shell for the JVM
CRaSH the shell for the JVMCRaSH the shell for the JVM
CRaSH the shell for the JVM
 
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
Peeking into the Black Hole Called PL/PGSQL - the New PL Profiler / Jan Wieck...
 
Rex - Lightning Talk yapc.eu 2013
Rex - Lightning Talk yapc.eu 2013Rex - Lightning Talk yapc.eu 2013
Rex - Lightning Talk yapc.eu 2013
 
Newgenlib Installation on Ubuntu 12.04
Newgenlib Installation on Ubuntu 12.04Newgenlib Installation on Ubuntu 12.04
Newgenlib Installation on Ubuntu 12.04
 
nginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottlenginx + uwsgi emperor + bottle
nginx + uwsgi emperor + bottle
 
Multiple django applications on a single server with nginx
Multiple django applications on a single server with nginxMultiple django applications on a single server with nginx
Multiple django applications on a single server with nginx
 
Integrating the Ruby Debugger into YaST
Integrating the Ruby Debugger into YaSTIntegrating the Ruby Debugger into YaST
Integrating the Ruby Debugger into YaST
 
Npm scripts
Npm scriptsNpm scripts
Npm scripts
 
CIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterCIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops better
 
Владимир Перепелица "Модули"
Владимир Перепелица "Модули"Владимир Перепелица "Модули"
Владимир Перепелица "Модули"
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & more
 
Node js
Node jsNode js
Node js
 
Vagrant
VagrantVagrant
Vagrant
 
20151229 wnmp & phalcon micro app - part I
20151229 wnmp & phalcon micro app - part I20151229 wnmp & phalcon micro app - part I
20151229 wnmp & phalcon micro app - part I
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
 

Similar a LibreOffice oss-fuzz, crashtesting, coverity

Fuzzing: The New Unit Testing
Fuzzing: The New Unit TestingFuzzing: The New Unit Testing
Fuzzing: The New Unit TestingDmitry Vyukov
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made EasyAlon Fliess
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopardtutorialsruby
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopardtutorialsruby
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesPuppet
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakNETWAYS
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsGR8Conf
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at ScaleKris Buytaert
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack SummitMiguel Zuniga
 
Process (OS),GNU,Introduction to Linux oS
Process (OS),GNU,Introduction to Linux oSProcess (OS),GNU,Introduction to Linux oS
Process (OS),GNU,Introduction to Linux oSHarrytoye2
 
Sample Project using design patterns and agile
Sample Project using design patterns and agileSample Project using design patterns and agile
Sample Project using design patterns and agileVicente Bolea
 
Tuning systemd for embedded
Tuning systemd for embeddedTuning systemd for embedded
Tuning systemd for embeddedAlison Chaiken
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewiredotCloud
 
Pluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and DockerPluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and DockerBob Killen
 
One Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launchesOne Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launchesLeszek Godlewski
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...OpenShift Origin
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guidevjvarenya
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 

Similar a LibreOffice oss-fuzz, crashtesting, coverity (20)

Fuzzing: The New Unit Testing
Fuzzing: The New Unit TestingFuzzing: The New Unit Testing
Fuzzing: The New Unit Testing
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
 
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_LeopardAdding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
Adding_GD2_to_PHP_on_OS_X_Server_10_5_Leopard
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
 
Process (OS),GNU,Introduction to Linux oS
Process (OS),GNU,Introduction to Linux oSProcess (OS),GNU,Introduction to Linux oS
Process (OS),GNU,Introduction to Linux oS
 
ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013
 
Sample Project using design patterns and agile
Sample Project using design patterns and agileSample Project using design patterns and agile
Sample Project using design patterns and agile
 
Tuning systemd for embedded
Tuning systemd for embeddedTuning systemd for embedded
Tuning systemd for embedded
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Pluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and DockerPluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and Docker
 
One Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launchesOne Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launches
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guide
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 

Último

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 

Último (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 

LibreOffice oss-fuzz, crashtesting, coverity

  • 4. Overview ● Continuous Fuzzing of our import filters ● Thanks to Google we get to use their infrastructure and resources
  • 5. Configuration ● Build remotely on google’s side – Calls our bin/oss-fuzz-build.sh ● 45 fuzzer targets in vcl/workben ● Each one is built with – libfuzzer + asan – libfuzzer + ubsan – afl + asan – honggfuzz + asan => 180 total
  • 6. Configuration ● No dynamic libraries allowed – A serious pain for us – distro-configs/LibreOfficeOssFuzz.conf – Reuse --disable-dynamic-loading intended for iOS – Individual fuzzers are unfortunately v. large ● Run without config layer – Hardcoded suitable default for –enable-fuzzers – utl::ConfigManager::IsAvoidConfig() ● https://dev-www.libreoffice.org/corpus/ – Contains our seed corpuses for 60 file formats – 15 are dtardons and co’s dlplib filters and are fuzzed separately
  • 7. Oss-Fuzz Reports per Year • Over 1100 issues over four years 2017 2018 2019 2020 0 50 100 150 200 250 300 350 400 450 500 oss-fuzz: Last 4 Years Projected Filed Year Reports • More than one a day in 2017 and 2018 • 113 this year to date, estimate 142 by end of year • This years uptick due to a new route from sftfuzzer into old untested code
  • 8. What a report looks like Auto minimize
  • 9. Sample ubsan bug ● Buggy change, the unsigned short is promoted to int, undefined behavior in addition ● Change back to a larger unsigned type
  • 10. Timeouts ● Sometimes timeout is genuine infinite loop – More often it’s just slow ● OssFuzz will report a maximum of one timeout per fuzzer ● Fix a timeout, another typically gets reported soon after ● Limit input size with a .options files [libfuzzer] max_len = 65536 ● Some file formats have ~infinite decompression support – Tiny input can legitimately provide mega data to process – Examine FUZZ_MAX_INPUT_LEN (from .options) at runtime and limit to some factor of that
  • 11. OOM ● Limit memory usage with setenv("JPEGMEM", "768M", 1); setenv("SC_MAX_MATRIX_ELEMENTS", "60000000", 1); setenv("SC_NO_THREADED_CALCULATION", "1", 1); ● Pre-allocating buffers depending on potentially lying headers – Often a known relationship between remaining length of the file and the amount of data that it can produce – So short reads can be predicted before buffer allocation ● GIF’s have a max compression of ~1:2560,
  • 12. Current Open Bugs ● 10 open bugs – All Timeouts
  • 14. Overview ● Document Corpus – Most scraped out of various bugzilla instances with get-bugzilla-attachments-by-mimetype – 116,200 files ● Import them all – With Markus Mohrhard’s test-bugzilla-files ● For many formats, then export to multiple formats ● Reimport exported output ● Report failed imports/exports ● Backtraces extracted from coredumps
  • 15. New Setup ● New Hardware this year – Next day results – Vs ~3 days with old setup ● Thanks to Adfinis
  • 16. 12 Months of Importing ● Persistent <10 cluster of failures 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 0 10 20 30 40 50 60 70 Import Failures Import Build Failures
  • 17. 12 Months of Exporting ● Large jumps as regressions detected and fixed 1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 0 50 100 150 200 250 300 Export Failures Export Build Failures
  • 19. Configuration ● Build locally with coverity’s tooling ● Outputs a big blob which we upload to their server which does the analysis ● https://scan.coverity.com/projects/libreoffice ● Project settings are open, no need to apply to be a “member” to see the findings ● Contemporary coverity scans both C++ and Java ● Coverity currently supports C++17, but not C++2a – patch configure.ac to not try c++2a for the coverity run ● We only scan LibreOffice, not dependencies – distro-configs/LibreOfficeCoverity.conf – So no ignored “external” category anymore
  • 20. Example warning ● uninit_member – If a class initializes none of its members in its ctors there is no warning as its assumed to be intentional – If it initializes most of them, it warns about the uninitialized ones – A common mistake is with a class with multiple ctors, new member gets added and initialized in one ctor but not the other warning type
  • 21. Pattern for waiving warnings ● An issue can be marked as a false positive or intentional in the web UI – But that only affects that coverity instance. Red Hat runs another one f.e. – If the code changes enough coverity will loose the ability to detect its the same code and reissue the warning ● INTENTIONAL pattern – // coverity[WARNING] - OPTIONAL_COMMENT – WARNING is the text before the : in the report – – – ● FALSE POSITIVE pattern – // coverity[WARNING : FALSE] - OPTIONAL_COMMENT
  • 22. Pattern to indicate program exit ● // coverity[+kill] indicates that the annotated function is intended to kill the program – – – ● We use this in cppunit to indicate that that Asserter::fail is intended to exit the program. In reality it throws a deliberately unhandled exception which would be warned about otherwise ● Note that –enable-assert-always-abort is active for our coverity builds so failing asserts terminate program flow so coverity warnings about “impossible” situations are resolvable by adding appropriate asserts
  • 23. Tainted data ● Coverity detects common byteswapping techniques as indicating that data is probably untrusted tainted data ● Very helpful for our general file format parsing, but not for our own legacy registry data format ● __coverity_tainted_data_sanitize__ can be used to sanitize the data
  • 24. Tainted data ● Validating untrusted data – A simple sanity test of tainted example
  • 25. Outstanding vs Fixed defects Gap between requiring C++17 and coverity support