Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion projects/cpython3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ RUN apt-get update && \
apt-get install -y build-essential libncursesw5-dev \
libreadline-dev libssl-dev libgdbm-dev \
libc6-dev libsqlite3-dev tk-dev libbz2-dev \
zlib1g-dev libffi-dev
libffi-dev autoconf automake autopoint libtool

# zlib and liblzma are built from source with sanitizer instrumentation
# in build.sh
RUN git clone --depth 1 -b master https://github.com/madler/zlib.git zlib
RUN git clone --depth 1 https://github.com/tukaani-project/xz.git xz

RUN git clone https://github.com/python/cpython.git cpython3
WORKDIR cpython3
Expand Down
26 changes: 26 additions & 0 deletions projects/cpython3/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,33 @@ CFLAGS="${CFLAGS} -UNDEBUG"
# We use some internal CPython API.
CFLAGS="${CFLAGS} -IInclude/internal/"

# Build zlib from source with the sanitizer/coverage flags
ZLIB_PREFIX=$WORK/zlib
pushd $SRC/zlib
./configure --static --prefix=$ZLIB_PREFIX
# Build as a static library since it's linked into shared extension modules
make -j$(nproc) CFLAGS="$CFLAGS -fPIC"
make install
popd

# Build liblzma from source with the sanitizer/coverage flags
LZMA_PREFIX=$WORK/xz
pushd $SRC/xz
./autogen.sh --no-po4a --no-doxygen
# Static + PIC for the same reason as zlib. Also, we can skip the command line tools
./configure --prefix=$LZMA_PREFIX \
--enable-static --disable-shared --with-pic --enable-debug \
--disable-xz --disable-xzdec --disable-lzmadec --disable-lzmainfo \
--disable-nls --disable-doc
make -j$(nproc)
make install
popd

FLAGS=()
FLAGS+=("ZLIB_CFLAGS=-I$ZLIB_PREFIX/include")
FLAGS+=("ZLIB_LIBS=$ZLIB_PREFIX/lib/libz.a")
FLAGS+=("LIBLZMA_CFLAGS=-I$LZMA_PREFIX/include")
FLAGS+=("LIBLZMA_LIBS=$LZMA_PREFIX/lib/liblzma.a -lpthread")
case $SANITIZER in
address)
FLAGS+=("--with-address-sanitizer")
Expand Down
2 changes: 1 addition & 1 deletion projects/git/project.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
homepage: "https://git-scm.com"
language: rust
language: c++
primary_contact: "steadmon@google.com"
auto_ccs:
- "git-fuzz-reports@google.com"
Expand Down
2 changes: 1 addition & 1 deletion projects/monero/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Multistage docker build, requires docker 17.05

# builder stage
FROM gcr.io/oss-fuzz-base/base-builder
FROM gcr.io/oss-fuzz-base/base-builder-rust

RUN set -ex && \
apt-get update && \
Expand Down
3 changes: 2 additions & 1 deletion projects/monero/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export CXXFLAGS="${CXXFLAGS} -fPIC -DBOOST_NO_INCLASS_MEMBER_INITIALIZATION"
# `set(Boost_USE_STATIC_RUNTIME ON)`. The OSS-Fuzz image builds Boost with
# `runtime-link=static`, so config-mode find_package rejects that variant unless
# Boost_USE_STATIC_RUNTIME is ON. Re-supply it here to match the image's Boost.
cmake -D OSSFUZZ=ON -D STATIC=ON -D BUILD_TESTS=ON -D USE_LTO=OFF -D ARCH="default" -D Boost_USE_STATIC_RUNTIME=ON ..
cmake -D OSSFUZZ=ON -D STATIC=ON -D BUILD_TESTS=ON -D USE_LTO=OFF \
-D USE_DEVICE_TREZOR=OFF -D ARCH="default" -D Boost_USE_STATIC_RUNTIME=ON ..

TESTS="\
base58_fuzz_tests \
Expand Down
2 changes: 1 addition & 1 deletion projects/ogre/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update -y && apt-get install -y curl libgtest-dev libx11-dev
RUN git clone --depth 1 https://github.com/OGRECave/ogre
COPY build.sh *.cpp *.dict $SRC/
COPY build.sh $SRC/
WORKDIR ogre
11 changes: 9 additions & 2 deletions projects/ogre/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cmake -DOGRE_STATIC=TRUE -DOGRE_BUILD_FUZZERS=TRUE -DCMAKE_CXX_FLAGS="$CXXFLAGS"
make -j$(nproc)

# copy the fuzzers
for fuzzer in image_fuzz stream_fuzz zip_fuzz ogre_deep_fuzz script_fuzz; do
for fuzzer in image_fuzz stream_fuzz zip_fuzz ogre_deep_fuzz script_fuzz dds_fuzz; do
cp bin/${fuzzer} $OUT/${fuzzer}
done

Expand Down Expand Up @@ -55,5 +55,12 @@ for f in $(find .. -name '*.material' -o -name '*.program' \
cp "$f" "/tmp/ogre_script_seeds/$base"
done

# Seed corpus for the DDS codec fuzzer
mkdir -p /tmp/ogre_dds_seeds
for f in $(find .. -iname '*.dds'); do
cp "$f" "/tmp/ogre_dds_seeds/$(echo "${f#../}" | tr '/' '_')"
done

cd /tmp/ogre_deep_seeds && zip -q $OUT/ogre_deep_fuzz_seed_corpus.zip * 2>/dev/null || true
cd /tmp/ogre_script_seeds && zip -q $OUT/script_fuzz_seed_corpus.zip * 2>/dev/null || true
cd /tmp/ogre_script_seeds && zip -q $OUT/script_fuzz_seed_corpus.zip * 2>/dev/null || true
cd /tmp/ogre_dds_seeds && zip -q $OUT/dds_fuzz_seed_corpus.zip * 2>/dev/null || true
18 changes: 12 additions & 6 deletions projects/open5gs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ ninja -C builddir -k 0 \
tests/fuzzing/pfcp_message_fuzz \
tests/fuzzing/nas_5gs_message_fuzz \
tests/fuzzing/sbi_nf_profile_fuzz \
tests/fuzzing/sbi_sm_context_fuzz
tests/fuzzing/sbi_sm_context_fuzz \
tests/fuzzing/sbi_openapi_model_fuzz \
tests/fuzzing/sbi_request_fuzz

cp builddir/tests/fuzzing/gtp_message_fuzz $OUT/gtp_message_fuzz
cp builddir/tests/fuzzing/ipfw_rule_fuzz $OUT/ipfw_rule_fuzz
cp builddir/tests/fuzzing/nas_message_fuzz $OUT/nas_message_fuzz
cp builddir/tests/fuzzing/ngap_message_fuzz $OUT/ngap_message_fuzz
cp builddir/tests/fuzzing/s1ap_message_fuzz $OUT/s1ap_message_fuzz
Expand All @@ -53,17 +54,22 @@ mkdir -p $OUT/lib/
cp /lib/x86_64-linux-gnu/libtalloc.so* $OUT/lib/

cp tests/fuzzing/gtp_message_fuzz_seed_corpus.zip $OUT/gtp_message_fuzz_seed_corpus.zip
cp tests/fuzzing/ipfw_rule_fuzz_seed_corpus.zip $OUT/ipfw_rule_fuzz_seed_corpus.zip
cp tests/fuzzing/nas_message_fuzz_seed_corpus.zip $OUT/nas_message_fuzz_seed_corpus.zip
cp tests/fuzzing/pfcp_message_fuzz_seed_corpus.zip $OUT/pfcp_message_fuzz_seed_corpus.zip
cp tests/fuzzing/nas_5gs_message_fuzz_seed_corpus.zip $OUT/nas_5gs_message_fuzz_seed_corpus.zip

# Disable sbi related fuzzers for memory sanitizer because it depends on
# libtalloc which contains a MSAN false positive problem
# Disable sbi/ipfw related fuzzers for memory sanitizer because they depend
# on the system libtalloc, which is not MSAN-instrumented and causes false
# positives.
if [ "$SANITIZER" != "memory" ]; then
cp builddir/tests/fuzzing/ipfw_rule_fuzz $OUT/ipfw_rule_fuzz
cp tests/fuzzing/ipfw_rule_fuzz_seed_corpus.zip $OUT/ipfw_rule_fuzz_seed_corpus.zip

cp builddir/tests/fuzzing/sbi_nf_profile_fuzz $OUT/sbi_nf_profile_fuzz
cp builddir/tests/fuzzing/sbi_sm_context_fuzz $OUT/sbi_sm_context_fuzz
for fuzzer in sbi_nf_profile_fuzz sbi_sm_context_fuzz;
cp builddir/tests/fuzzing/sbi_openapi_model_fuzz $OUT/sbi_openapi_model_fuzz
cp builddir/tests/fuzzing/sbi_request_fuzz $OUT/sbi_request_fuzz
for fuzzer in sbi_nf_profile_fuzz sbi_sm_context_fuzz sbi_openapi_model_fuzz sbi_request_fuzz;
do
ldd "$OUT/$fuzzer" 2>/dev/null | awk '/=> \//{print $3}'
done | grep -Ev '/(ld-linux|libc|libm|libdl|libpthread|librt|libstdc\+\+|libgcc_s)\.' \
Expand Down
3 changes: 2 additions & 1 deletion projects/rabbitmq-c/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#
################################################################################
mkdir build
mkdir build

pushd build/

Expand All @@ -35,6 +35,7 @@ cp fuzz/fuzz_method_decode $OUT/fuzz_method_decode
cp fuzz/fuzz_handle_input $OUT/fuzz_handle_input
cp fuzz/fuzz_properties_decode $OUT/fuzz_properties_decode
cp fuzz/fuzz_codec $OUT/fuzz_codec
cp fuzz/fuzz_read_message $OUT/fuzz_read_message
popd

zip -j ${OUT}/fuzz_url_seed_corpus.zip fuzz/input/fuzz_url.raw
Expand Down
Loading