Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer
78 changes: 78 additions & 0 deletions .github/workflows/fuzzing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Fuzzing with CI Fuzz

# Runs all fuzz tests in this repository with CI Fuzz.

# You need to set CIFUZZ_DOWNLOAD_TOKEN as a repository secret. Get the token
# from https://downloads.code-intelligence.com/.

# Run workflow each time code is pushed to default branch of the repository,
# for every pull request to the default branch and on a schedule. Allow to
# run this workflow manually.
# The scheduled workflow runs every day at 03:50 UTC.
on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
schedule:
- cron: '50 03 * * *'
workflow_dispatch:

jobs:
fuzz:
runs-on: ubuntu-latest

permissions:
# Please comment-out the ones you don't need and uncomment the ones you do need

# Required to upload Findings to GitHub code scanning
security-events: write

# Required to commit Findings to repository
# contents: write

steps:
- name: Install dependecies
run: |
sudo apt update
sudo apt install clang llvm lcov

- name: Checkout repository
uses: "actions/checkout@v4"

- name: Install CI Fuzz
uses: "CodeIntelligenceTesting/actions/install-cifuzz@v2"
with:
version: latest
download-token: ${{ secrets.CIFUZZ_DOWNLOAD_TOKEN }}


# Needs configuration of rclone
# - name: Copy corpus from cloud storage
# run: |
# mkdir -p .cifuzz-corpus
# rclone copy -v cloud-storage:corpora/PROJECT_NAME .cifuzz-corpus

- name: Run fuzzing
uses: "CodeIntelligenceTesting/actions/run-fuzzing@v2"
with:
duration: 15s

# Needs configuration of rclone
# - name: Copy corpus to cloud storage
# run: |
# rclone copy -v .cifuzz-corpus cloud-storage:corpora/PROJECT_NAME

- name: Upload code-scanning report
if: always()
uses: "CodeIntelligenceTesting/actions/upload-code-scanning-report@v2"

# Uncomment this step if you want to commit all Findings found when running this workflow:
# - name: Commit Findings to repository
# run: |
# git config --global user.name 'GitHub Action'
# git config --global user.email 'zgtm@users.noreply.github.com'
# git add .cifuzz-findings
# git commit -m "Automated commit of CI Fuzz Findings"
# git push

26 changes: 19 additions & 7 deletions cifuzz.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Configuration for a CI Fuzz project
## Generated on 2025-04-15
## Generated on 2025-06-23

## The build system used to build this project. If not set, cifuzz tries to
## detect the build system automatically.
Expand All @@ -8,7 +8,13 @@ build-system: cmake

## Engine used for fuzzing, default is "libfuzzer-clang".
## Valid values: "libfuzzer-clang", "honggfuzz-clang", "honggfuzz-gcc"
#engine: honggfuzz-gcc
engine: libfuzzer-clang

## Sanitizers to use when building fuzz tests. If not set, ASan and UBSan
## are used by default.
#sanitizers:
# - address
# - undefined

## If the build system type is "other", this command is used to build the fuzz
## tests.
Expand All @@ -27,6 +33,7 @@ build-system: cmake
#build-system-args:
# - -DBUILD_TESTS=ON


## Directories containing sample inputs used as seeds for running fuzz tests.
## For general information on seed corpora, see:
## https://docs.code-intelligence.com/glossary#seed-corpus
Expand All @@ -43,12 +50,17 @@ build-system: cmake
## For libFuzzer see: https://llvm.org/docs/LibFuzzer.html#dictionaries
#dict: path/to/dictionary.dct

## Command-line arguments to pass to the fuzzing engine when running fuzz tests.
## For libFuzzer see: https://llvm.org/docs/LibFuzzer.html#options
engine-args:
- -use_value_profile=1 # Only use value profile with libFuzzer! Never use it with Honggfuzz!
## Command-line arguments to pass to libFuzzer when running fuzz tests.
## See https://llvm.org/docs/LibFuzzer.html#options for possible options.
libfuzzer-args:
- -use_value_profile=1
# - -rss_limit_mb=4096

## Command-line arguments to pass to Honggfuzz when running fuzz tests.
## See https://github.com/google/honggfuzz/blob/master/docs/USAGE.md for possible options.
#honggfuzz-args:
# - --rlimit_rss=4096

## Maximum time to run all fuzz tests. Default is 10 minutes. The time will be
## split up evenly between multiple fuzz tests. To keep running indefinitely,
## set value to 0.
Expand All @@ -63,4 +75,4 @@ max-idle-time: 0

## Set style for command output.
## Valid values: "pretty", "plain"
#style: plain
#style: plain