1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-23 07:58:09 +00:00

Run fuzzer in CI

Signed-off-by: AdamKorcz <Adam@adalogics.com>
This commit is contained in:
AdamKorcz 2022-07-28 15:26:16 +01:00 committed by matejcik
parent 20805af8a5
commit fe75647b43
4 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,6 @@
FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && apt-get install -y make autoconf automake libtool \
pkg-config
COPY . $SRC/trezor-firmware
WORKDIR $SRC/trezor-firmware/crypto
COPY .clusterfuzzlite/build.sh $SRC/

5
.clusterfuzzlite/build.sh Executable file
View File

@ -0,0 +1,5 @@
# reset sanitizer and optimization flags to avoid interfering with $CFLAGS
export SANFLAGS=""
export OPTFLAGS="-O3 -march=native -gline-tables-only"
FUZZER=1 VALGRIND=0 make -j$(nproc) fuzzer
mv fuzzer/fuzzer $OUT/

View File

@ -0,0 +1 @@
language: c

29
.github/workflows/cflite.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: ClusterFuzzLite PR fuzzing
on:
workflow_dispatch:
pull_request:
paths:
- '**'
permissions: read-all
jobs:
PR:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitizer: [address]
steps:
- name: Build Fuzzers (${{ matrix.sanitizer }})
id: build
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
with:
sanitizer: ${{ matrix.sanitizer }}
language: c
- name: Run Fuzzers (${{ matrix.sanitizer }})
id: run
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fuzz-seconds: 400
mode: 'code-change'
sanitizer: ${{ matrix.sanitizer }}