3 Fuzzing supplies valid, invalid, unexpected or random data as input to a piece
4 of code. Instrumentation, usually compiler-implemented, is used to monitor for
5 exceptions such as crashes, assertions or memory corruption.
7 See [Wikipedia article on fuzzing](https://en.wikipedia.org/wiki/Fuzzing) for
12 ## Configure with fuzzing
14 Example command line to build binaries for use with
15 [honggfuzz](https://github.com/google/honggfuzz/):
18 buildtools/bin/waf -C --without-gettext --enable-debug --enable-developer \
19 --address-sanitizer --enable-libfuzzer --abi-check-disable \
20 CC=.../honggfuzz/hfuzz_cc/hfuzz-clang configure \
21 LINK_CC=.../honggfuzz/hfuzz_cc/hfuzz-clang
27 Example for fuzzing `tiniparser` using `honggfuzz` (see `--help` for more
31 buildtools/bin/waf --targets=fuzz_tiniparser build && \
32 .../honggfuzz/honggfuzz --sanitizers --timeout 3 --max_file_size 256 \
33 --rlimit_rss 100 -f .../tiniparser-corpus -- bin/fuzz_tiniparser
36 # AFL (american fuzzy lop)
38 ## Configure with fuzzing
40 Example command line to build binaries for use with
41 [afl](http://lcamtuf.coredump.cx/afl/)
44 buildtools/bin/waf -C --without-gettext --enable-debug --enable-developer \
45 --enable-afl-fuzzer --abi-check-disable \
51 Example for fuzzing `tiniparser` using `afl-fuzz` (see `--help` for more
55 buildtools/bin/waf --targets=fuzz_tiniparser build && \
56 afl-fuzz -m 200 -i inputdir -o outputdir -- bin/fuzz_tiniparser
61 Samba can be fuzzed by Google's oss-fuzz system. Assuming you have an
62 oss-fuzz checkout from https://github.com/google/oss-fuzz with Samba's
63 metadata in projects/samba, the following guides will help:
67 https://google.github.io/oss-fuzz/getting-started/new-project-guide/#testing-locally
71 See https://google.github.io/oss-fuzz/advanced-topics/debugging/
73 ## Samba-specific hints
75 A typical debugging workflow is:
77 oss-fuzz$ python infra/helper.py shell samba
78 git fetch $REMOTE $BRANCH
79 git checkout FETCH_HEAD
80 lib/fuzzing/oss-fuzz/build_image.sh
83 This will pull in any new Samba deps and build Samba's fuzzers.
85 # vim: set sw=8 sts=8 ts=8 tw=79 :