SlideShare a Scribd company logo
1 of 26
Download to read offline
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

More Related Content

What's hot

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
 

What's hot (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 to 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 to 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
 

Recently uploaded

How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
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
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

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