smbstatus: add frame files for json specific methods
[Samba.git] / lib / fuzzing / README.md
blobd3e34bd79a36cf01efb4b29629e48ca35d0859e6
1 # Fuzzing Samba
3 See also https://wiki.samba.org/index.php/Fuzzing
5 Fuzzing supplies valid, invalid, unexpected or random data as input to a piece
6 of code. Instrumentation, usually compiler-implemented, is used to monitor for
7 exceptions such as crashes, assertions or memory corruption.
9 See [Wikipedia article on fuzzing](https://en.wikipedia.org/wiki/Fuzzing) for
10 more information.
12 # Honggfuzz
14 ## Configure with fuzzing
16 Example command line to build binaries for use with
17 [honggfuzz](https://github.com/google/honggfuzz/):
19 ```sh
20 ./configure -C --without-gettext --enable-debug --enable-developer \
21         --address-sanitizer --enable-libfuzzer --abi-check-disable \
22         CC=.../honggfuzz/hfuzz_cc/hfuzz-clang \
23         LINK_CC=.../honggfuzz/hfuzz_cc/hfuzz-clang
24 ```
27 ## Fuzzing tiniparser
29 Example for fuzzing `tiniparser` using `honggfuzz` (see `--help` for more
30 options):
32 ```sh
33 make bin/fuzz_tiniparser && \
34 .../honggfuzz/honggfuzz --sanitizers --timeout 3 --max_file_size 256 \
35   --rlimit_rss 100 -f .../tiniparser-corpus -- bin/fuzz_tiniparser
36 ```
38 # AFL (american fuzzy lop)
40 ## Configure with fuzzing
42 Example command line to build binaries for use with
43 [afl](http://lcamtuf.coredump.cx/afl/)
45 ```sh
46 ./configure -C --without-gettext --enable-debug --enable-developer \
47         --enable-afl-fuzzer --abi-check-disable \
48         CC=afl-gcc
49 ```
51 ## Fuzzing tiniparser
53 Example for fuzzing `tiniparser` using `afl-fuzz` (see `--help` for more
54 options):
56 ```sh
57 make bin/fuzz_tiniparser build && \
58 afl-fuzz -m 200 -i inputdir -o outputdir -- bin/fuzz_tiniparser
59 ```
61 # oss-fuzz
63 Samba can be fuzzed by Google's oss-fuzz system.  Assuming you have an
64 oss-fuzz checkout from https://github.com/google/oss-fuzz with Samba's
65 metadata in projects/samba, the following guides will help:
67 ## Testing locally
69 https://google.github.io/oss-fuzz/getting-started/new-project-guide/#testing-locally
71 ## Debugging oss-fuzz
73 See https://google.github.io/oss-fuzz/advanced-topics/debugging/
75 ## Samba-specific hints
77 A typical debugging workflow is:
79 oss-fuzz$ python infra/helper.py shell samba
80 git fetch $REMOTE $BRANCH
81 git checkout FETCH_HEAD
82 lib/fuzzing/oss-fuzz/build_image.sh
83 compile
85 This will pull in any new Samba deps and build Samba's fuzzers.
87 # vim: set sw=8 sts=8 ts=8 tw=79 :