File tree Expand file tree Collapse file tree 6 files changed +74
-0
lines changed Expand file tree Collapse file tree 6 files changed +74
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM gcr.io/oss-fuzz-base/base-builder
2
+ RUN apt-get update && apt-get install -y make autoconf automake libtool
3
+
4
+ COPY . $SRC/corejson
5
+ COPY .clusterfuzzlite/build.sh $SRC/build.sh
6
+ WORKDIR $SRC/corejson
Original file line number Diff line number Diff line change
1
+ # ClusterFuzzLite set up
2
+
3
+ This folder contains a fuzzing set for [ ClusterFuzzLite] ( https://google.github.io/clusterfuzzlite ) .
4
+
5
+
6
+ ## Running the fuzzer locally
7
+
8
+ To reproduce the fuzzing by way of [ OSS-Fuzz] ( https://github.com/google/oss-fuzz ) (which ClusterFuzzLite will be using):
9
+
10
+ ``` sh
11
+ git clone https://github.com/google/oss-fuzz
12
+
13
+ # Notice the destination folder shuold be in lower case.
14
+ git clone https://github.com/FreeRTOS/coreJSON corejson
15
+ cd corejson
16
+
17
+ # Build the fuzzers in .clusterfuzzlite
18
+ python3 ../oss-fuzz/infra/helper.py build_fuzzers --external $PWD
19
+
20
+ # Run the fuzzer for 180 seconds
21
+ python3 ../oss-fuzz/infra/helper.py run_fuzzer --external $PWD validate_fuzzer -- -max_total_time=180
22
+ ```
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -eu
2
+
3
+ # Copy the fuzzer executable to $OUT/
4
+ $CC $CFLAGS $LIB_FUZZING_ENGINE \
5
+ $SRC /corejson/.clusterfuzzlite/validate_fuzzer.c \
6
+ $SRC /corejson/source/core_json.c \
7
+ -I$SRC /corejson/source/include \
8
+ -o $OUT /validate_fuzzer
Original file line number Diff line number Diff line change
1
+ language : c
Original file line number Diff line number Diff line change
1
+ #include <core_json.h>
2
+ #include <stdint.h>
3
+
4
+ int LLVMFuzzerTestOneInput (const uint8_t * data , size_t size ) {
5
+ JSON_Validate ((char * )data , size );
6
+ return 0 ;
7
+ }
Original file line number Diff line number Diff line change
1
+ name : ClusterFuzzLite PR fuzzing
2
+ on :
3
+ workflow_dispatch :
4
+ pull_request :
5
+ branches : [ main ]
6
+ permissions : read-all
7
+ jobs :
8
+ PR :
9
+ runs-on : ubuntu-latest
10
+ strategy :
11
+ fail-fast : false
12
+ matrix :
13
+ sanitizer : [address]
14
+ steps :
15
+ - name : Build Fuzzers (${{ matrix.sanitizer }})
16
+ id : build
17
+ uses : google/clusterfuzzlite/actions/build_fuzzers@v1
18
+ with :
19
+ sanitizer : ${{ matrix.sanitizer }}
20
+ language : c
21
+ bad-build-check : false
22
+ - name : Run Fuzzers (${{ matrix.sanitizer }})
23
+ id : run
24
+ uses : google/clusterfuzzlite/actions/run_fuzzers@v1
25
+ with :
26
+ github-token : ${{ secrets.GITHUB_TOKEN }}
27
+ fuzz-seconds : 180
28
+ mode : ' code-change'
29
+ report-unreproducible-crashes : false
30
+ sanitizer : ${{ matrix.sanitizer }}
You can’t perform that action at this time.
0 commit comments