aboutsummaryrefslogtreecommitdiff
path: root/projects/firefox
diff options
context:
space:
mode:
authorChristoph Diehl <1614333+posidron@users.noreply.github.com>2019-08-10 03:10:19 +0200
committerAbhishek Arya <inferno@chromium.org>2019-08-09 18:10:19 -0700
commit28dd637dc8e71f58dacb16c225376b3e3f0c869d (patch)
treed45e74e96d7307c6031e0374d693cfdf67bd0661 /projects/firefox
parent40a183b53faa4349cd3e34a09783e487e8179f78 (diff)
downloadoss-fuzz-28dd637dc8e71f58dacb16c225376b3e3f0c869d.tar.gz
Add outstanding LibFuzzer targets to Firefox (#2675)
Diffstat (limited to 'projects/firefox')
-rw-r--r--projects/firefox/Dockerfile12
-rw-r--r--projects/firefox/ImageBMP.options2
-rw-r--r--projects/firefox/ImageGIF.options2
-rwxr-xr-xprojects/firefox/build.sh22
4 files changed, 30 insertions, 8 deletions
diff --git a/projects/firefox/Dockerfile b/projects/firefox/Dockerfile
index ee75198b9..abc077c6b 100644
--- a/projects/firefox/Dockerfile
+++ b/projects/firefox/Dockerfile
@@ -1,4 +1,4 @@
-# Copyright 2018 Google Inc.
+# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,8 +16,14 @@
FROM gcr.io/oss-fuzz-base/base-builder
MAINTAINER pdknsk@gmail.com
-RUN apt-get update && apt-get install -y gawk mercurial
-RUN hg clone --uncompressed https://hg.mozilla.org/mozilla-central
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ python \
+ gawk \
+ software-properties-common
+RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
+RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
+ libstdc++6
+RUN git clone --depth 1 https://github.com/mozilla/gecko-dev mozilla-central
RUN git clone --depth 1 https://github.com/mozillasecurity/fuzzdata
WORKDIR mozilla-central
COPY build.sh target.c *.options mozconfig.* $SRC/
diff --git a/projects/firefox/ImageBMP.options b/projects/firefox/ImageBMP.options
new file mode 100644
index 000000000..329a6e27b
--- /dev/null
+++ b/projects/firefox/ImageBMP.options
@@ -0,0 +1,2 @@
+[libfuzzer]
+close_fd_mask = 3
diff --git a/projects/firefox/ImageGIF.options b/projects/firefox/ImageGIF.options
new file mode 100644
index 000000000..329a6e27b
--- /dev/null
+++ b/projects/firefox/ImageGIF.options
@@ -0,0 +1,2 @@
+[libfuzzer]
+close_fd_mask = 3
diff --git a/projects/firefox/build.sh b/projects/firefox/build.sh
index 4cb28c79c..ad84fe7f6 100755
--- a/projects/firefox/build.sh
+++ b/projects/firefox/build.sh
@@ -1,5 +1,5 @@
#!/bin/bash -eu
-# Copyright 2018 Google Inc.
+# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,9 +20,11 @@ FUZZ_TARGETS=(
SdpParser
StunParser
ContentParentIPC
-# Targets which are available but disabled.
- # Qcms
- # ContentSecurityPolicyParser
+ CompositorManagerParentIPC
+ ContentSecurityPolicyParser
+ ImageGIF
+ ImageICO
+ ImageBMP
)
# Firefox object (build) directory and configuration file.
@@ -40,7 +42,7 @@ source $HOME/.cargo/env
# Update internal libFuzzer.
(cd tools/fuzzing/libfuzzer && ./clone_libfuzzer.sh HEAD)
-# Build! Takes about 15 minutes on a 32 vCPU instance.
+# Build!
./mach build
./mach gtest buildbutdontrun
@@ -83,3 +85,13 @@ cp $SRC/fuzzdata/dicts/stun.dict $OUT/StunParser.dict
# ContentParentIPC
cp $SRC/fuzzdata/settings/ipc/libfuzzer.content.blacklist.txt $OUT/firefox
+
+# ImageGIF
+zip -rj $OUT/ImageGIF_seed_corpus.zip $SRC/fuzzdata/samples/gif
+cp $SRC/fuzzdata/dicts/gif.dict $OUT/ImageGIF.dict
+
+# ImageICO
+zip -rj $OUT/ImageICO_seed_corpus.zip $SRC/fuzzdata/samples/ico
+
+# ImageBMP
+zip -rj $OUT/ImageBMP_seed_corpus.zip $SRC/fuzzdata/samples/bmp