Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix oss-fuzz patch #2058

Merged
merged 3 commits into from
Feb 5, 2025
Merged
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
58 changes: 57 additions & 1 deletion oss_fuzz_integration/oss-fuzz-patches.diff
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ index 64d11095b..34bee0c13 100644
# /ccache/bin will contain the compiler wrappers, and /ccache/cache will
# contain the actual cache, which can be saved.
diff --git a/infra/base-images/base-builder/compile b/infra/base-images/base-builder/compile
index e05d0e6ea..eccd5c3b3 100755
index e05d0e6ea..2554b9d3f 100755
--- a/infra/base-images/base-builder/compile
+++ b/infra/base-images/base-builder/compile
@@ -235,6 +235,8 @@ if [ "$SANITIZER" = "introspector" ] || [ "$RUST_SANITIZER" = "introspector" ];
Expand All @@ -32,6 +32,62 @@ index e05d0e6ea..eccd5c3b3 100755
elif [ "$FUZZING_LANGUAGE" = "jvm" ]; then
python3 /fuzz-introspector/src/main.py light --language=jvm
cp -rf $SRC/inspector/ /tmp/inspector-saved
@@ -353,28 +355,7 @@ if [ "$SANITIZER" = "introspector" ] || [ "$RUST_SANITIZER" = "introspector" ];
python3 -m pip install -e .
cd /src/

- if [ "$FUZZING_LANGUAGE" = "jvm" ]; then
- echo "GOING jvm route"
-
- set -x
- # Output will be put in /out/
- python3 -m fuzz_introspector.frontends.oss_fuzz --language jvm --target-dir $SRC --entrypoint fuzzerTestOneInput
-
- # Move files temporarily to fit workflow of other languages.
- mkdir -p $SRC/my-fi-data
- find ./ -name *.data -exec mv {} $SRC/my-fi-data/ \;
- find ./ -name *.data.yaml -exec mv {} $SRC/my-fi-data/ \;
- elif [ "$FUZZING_LANGUAGE" = "rust" ]; then
- echo "GOING rust route"
-
- # Run the rust frontend
- python3 -m fuzz_introspector.frontends.oss_fuzz --language rust --target-dir $SRC
-
- # Move files temporarily to fix workflow of other languages.
- mkdir -p $SRC/my-fi-data
- find ./ -name "*.data" -exec mv {} $SRC/my-fi-data/ \;
- find ./ -name "*.data.yaml" -exec mv {} $SRC/my-fi-data/ \;
-
+ if [ "$FUZZING_LANGUAGE" = "rust" ]; then
# Restore the sanitizer flag for rust
export SANITIZER="introspector"
fi
@@ -413,15 +394,21 @@ if [ "$SANITIZER" = "introspector" ] || [ "$RUST_SANITIZER" = "introspector" ];
echo "GOING jvm route"
set -x
find $OUT/ -name "jacoco.xml" -exec cp {} $SRC/inspector/ \;
- REPORT_ARGS="$REPORT_ARGS --target-dir=$SRC/inspector"
+ REPORT_ARGS="$REPORT_ARGS --target-dir=$SRC --out-dir=$SRC/inspector"
REPORT_ARGS="$REPORT_ARGS --language=jvm"
- fuzz-introspector report $REPORT_ARGS
+ fuzz-introspector full $REPORT_ARGS
rsync -avu --delete "$SRC/inspector/" "$OUT/inspector"
elif [ "$FUZZING_LANGUAGE" = "rust" ]; then
echo "GOING rust route"
- REPORT_ARGS="$REPORT_ARGS --target-dir=$SRC/inspector"
+ REPORT_ARGS="$REPORT_ARGS --target-dir=$SRC --out-dir=$SRC/inspector"
REPORT_ARGS="$REPORT_ARGS --language=rust"
- fuzz-introspector report $REPORT_ARGS
+ fuzz-introspector full $REPORT_ARGS
+ rsync -avu --delete "$SRC/inspector/" "$OUT/inspector"
+ elif [ "$FUZZING_LANGUAGE" = "go" ]; then
+ echo "GOING go route"
+ REPORT_ARGS="$REPORT_ARGS --target-dir=$SRC --out-dir=$SRC/inspector"
+ REPORT_ARGS="$REPORT_ARGS --language=go"
+ fuzz-introspector full $REPORT_ARGS
rsync -avu --delete "$SRC/inspector/" "$OUT/inspector"
else
# C/C++
diff --git a/infra/base-images/base-clang/Dockerfile b/infra/base-images/base-clang/Dockerfile
index 296b1f7fb..9c6b1ff55 100644
--- a/infra/base-images/base-clang/Dockerfile
Expand Down