syzkaller/fuzzit.sh
Yevgeny Pats e5701ed16c fuzzit.sh: migrate syzkaller to new org and introduce regression
The fuzzers now run on every new code that is pushed to master

Regression using the generated corpus from the above step is
run locally in the travis. This should fail the travis if new
or old bugs are introduce and thus help catch bugs earlier.

To reproduce locally you can run

./fuzzit create job --local syzkaller/target-name $PATH_TO_FUZZER
2019-08-09 11:56:42 +02:00

32 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2019 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
# Helper script for working with fuzzit.dev
# https://github.com/fuzzitdev/example-go
set -eux
function target {
go-fuzz-build -libfuzzer -func $3 -o fuzzer.a $2
clang -fsanitize=fuzzer fuzzer.a -o fuzzer
./fuzzit create job $LOCAL --type fuzzing --branch $TRAVIS_BRANCH --revision $TRAVIS_COMMIT syzkaller/$1 ./fuzzer
}
go get -u github.com/dvyukov/go-fuzz/go-fuzz-build
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.12/fuzzit_Linux_x86_64
chmod a+x fuzzit
if [ "$1" = "fuzzing" ]; then
./fuzzit auth ${FUZZIT_API_KEY}
export LOCAL=""
else
export LOCAL="--local"
fi
target syzkaller-prog-deserialize ./prog/test FuzzDeserialize
target syzkaller-prog-parselog ./prog/test FuzzParseLog
target syzkaller-compiler ./pkg/compiler Fuzz
target syzkaller-report ./pkg/report Fuzz
target syzkaller-trace2syz ./tools/syz-trace2syz/proggen Fuzz