Skip to content
Open
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
3 changes: 3 additions & 0 deletions docs/advanced-topics/reproducing.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ Once you reproduce the bug, you can do the following:
- **Improve fuzzing support:** Consider
[improving your integration with OSS-Fuzz]({{ site.baseurl }}/advanced-topics/ideal-integration/).

For `nallocfuzz` fuzzing engine, reproducing needs to use nallocfuzz itself.
If you launch the target yourself, without the python wrapper, be sure to use `-runs=2` or more.

## Reproducing build failures

Our infrastructure runs some sanity tests to make sure that your build was
Expand Down
2 changes: 2 additions & 0 deletions docs/getting-started/new_project_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ The list of fuzzing engines to use.
By default, `libfuzzer`, `afl`, `honggfuzz`, and `centipede` are used. It is recommended to
use all of them if possible. `libfuzzer` is required by OSS-Fuzz.

`nallocfuzz` is an optional fuzzing engine to test for allocation failures.

### help_url (optional) {#help_url}
A link to a custom help URL that appears in bug reports instead of the default
[OSS-Fuzz guide to reproducing crashes]({{ site.baseurl }}/advanced-topics/reproducing/). This can be useful if you assign
Expand Down
5 changes: 3 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ instances of [ClusterFuzz] or [ClusterFuzzLite].
[Core Infrastructure Initiative]: https://www.coreinfrastructure.org/
[OpenSSF]: https://www.openssf.org/

We support the [libFuzzer], [AFL++], [Honggfuzz], and [Centipede] fuzzing engines in
We support the [libFuzzer], [AFL++], [Honggfuzz], [Nallocfuzz], and [Centipede] fuzzing engines in
combination with [Sanitizers], as well as [ClusterFuzz], a distributed fuzzer
execution environment and reporting tool.

[libFuzzer]: https://llvm.org/docs/LibFuzzer.html
[AFL++]: https://github.com/AFLplusplus/AFLplusplus
[Honggfuzz]: https://github.com/google/honggfuzz
[Nallocfuzz]: https://github.com/catenacyber/nallocfuzz
[Centipede]: https://github.com/google/centipede
[Sanitizers]: https://github.com/google/sanitizers
[ClusterFuzz]: https://github.com/google/clusterfuzz
[ClusterFuzzLite]: https://google.github.io/clusterfuzzlite/

Currently, OSS-Fuzz supports C/C++, Rust, Go, Python and Java/JVM code. Other
Currently, OSS-Fuzz supports C/C++, Rust, Go, Python, Swift and Java/JVM code. Other
languages supported by [LLVM] may work too. OSS-Fuzz supports fuzzing x86_64
and i386 builds.

Expand Down
6 changes: 6 additions & 0 deletions infra/base-images/base-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ ENV FUZZER_LDFLAGS ""

WORKDIR $SRC

RUN git clone --depth 1 https://github.com/catenacyber/nallocfuzz.git
RUN git clone --depth 1 https://github.com/ianlancetaylor/libbacktrace.git $SRC/nallocfuzz/libbacktrace
COPY precompile_nallocfuzz /usr/local/bin/
RUN precompile_nallocfuzz

RUN git clone https://github.com/AFLplusplus/AFLplusplus.git aflplusplus && \
cd aflplusplus && \
git checkout daaefcddc063b356018c29027494a00bcfc3e240 && \
Expand Down Expand Up @@ -167,6 +172,7 @@ COPY bazel_build_fuzz_tests \
compile_javascript_fuzzer \
compile_libfuzzer \
compile_native_go_fuzzer \
compile_nallocfuzz \
compile_python_fuzzer \
debug_afl \
# Go, JavaScript, Java, Python, Rust, and Swift installation scripts.
Expand Down
22 changes: 22 additions & 0 deletions infra/base-images/base-builder/compile_nallocfuzz
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -eu
# Copyright 2023 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

echo "Skipping compilation; using precompiled nallocfuzz"

cp $SRC/nallocfuzz/nallocfuzz.a $LIB_FUZZING_ENGINE

echo " done."
32 changes: 32 additions & 0 deletions infra/base-images/base-builder/precompile_nallocfuzz
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash -eu
# Copyright 2023 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

echo "Precompiling nallocfuzz"

pushd $SRC/nallocfuzz/ > /dev/null
pushd libbacktrace > /dev/null
./configure
make -j$(nproc)
popd > /dev/null
clang -fPIE -I. -c nallocfuzz.c -o nallocfuzz.o
ar -x /usr/local/lib/clang/*/lib/linux/libclang_rt.fuzzer_no_main-$ARCHITECTURE.a
ar -x libbacktrace/.libs/libbacktrace.a
ar rcs nallocfuzz.a *.o
rm *.o
popd > /dev/null

echo "Done."
4 changes: 4 additions & 0 deletions infra/build/functions/build_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ class SignedPolicyDocument:
EngineInfo(upload_bucket='clusterfuzz-builds-centipede',
supported_sanitizers=['address', 'none'],
supported_architectures=['x86_64']),
'nallocfuzz':
EngineInfo(upload_bucket='clusterfuzz-builds-nallocfuzz',
supported_sanitizers=['address'],
supported_architectures=['x86_64']),
}

OSS_FUZZ_BUILDPOOL_NAME = os.getenv(
Expand Down
10 changes: 9 additions & 1 deletion infra/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,12 @@
'hwaddress',
]
ARCHITECTURES = ['i386', 'x86_64', 'aarch64']
ENGINES = ['libfuzzer', 'afl', 'honggfuzz', 'centipede', 'none', 'wycheproof']
ENGINES = [
'libfuzzer',
'afl',
'honggfuzz',
'centipede',
'none',
'wycheproof',
'nallocfuzz',
]
5 changes: 5 additions & 0 deletions projects/flac/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ sanitizers:
architectures:
- x86_64
- i386
fuzzing_engines:
- afl
- honggfuzz
- libfuzzer
- nallocfuzz
coverage_extra_args: -ignore-filename-regex=/usr/lib/jvm/.*
main_repo: 'https://github.com/xiph/flac.git'
1 change: 1 addition & 0 deletions projects/fluent-bit/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ fuzzing_engines:
- afl
- honggfuzz
- libfuzzer
- nallocfuzz
1 change: 1 addition & 0 deletions projects/libpng/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ fuzzing_engines:
- afl
- honggfuzz
- libfuzzer
- nallocfuzz

1 change: 1 addition & 0 deletions projects/libwebp/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: c++
primary_contact: "[email protected]"
fuzzing_engines:
- libfuzzer
- nallocfuzz
sanitizers:
- address
- undefined
Expand Down
5 changes: 5 additions & 0 deletions projects/ndpi/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ sanitizers:
- address
- undefined
- memory
fuzzing_engines:
- afl
- honggfuzz
- libfuzzer
- nallocfuzz
main_repo: 'https://github.com/ntop/nDPI.git'

#Coverage report doesn't analyze custom mutator code (see https://github.com/google/oss-fuzz/issues/12143)
Expand Down
1 change: 1 addition & 0 deletions projects/suricata/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ fuzzing_engines:
- afl
- honggfuzz
- libfuzzer
- nallocfuzz
main_repo: 'https://github.com/OISF/suricata.git'
1 change: 1 addition & 0 deletions projects/systemd/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fuzzing_engines:
- afl
- honggfuzz
- libfuzzer
- nallocfuzz
auto_ccs:
- [email protected]
- [email protected]
Expand Down
Loading