Index of /ftp/unpacked/samba_master/lib/fuzzing

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]README.md2024-04-24 06:25 2.2K 
[TXT]afl-fuzz-main.c2024-04-24 06:25 1.6K 
[   ]decode_ndr_X_crash2024-04-24 06:25 4.3K 
[TXT]fuzz_cli_credentials_parse_string.c2024-04-24 06:25 1.6K 
[TXT]fuzz_conditional_ace_blob.c2024-04-24 06:25 4.4K 
[TXT]fuzz_dcerpc_parse_binding.c2024-04-24 06:25 1.9K 
[TXT]fuzz_ldap_decode.c2024-04-24 06:25 1.6K 
[TXT]fuzz_ldb_comparison_fold.c2024-04-24 06:25 1.5K 
[TXT]fuzz_ldb_dn_explode.c2024-04-24 06:25 1.4K 
[TXT]fuzz_ldb_ldif_read.c2024-04-24 06:25 1.4K 
[TXT]fuzz_ldb_parse_binary_decode.c2024-04-24 06:25 1.5K 
[TXT]fuzz_ldb_parse_control.c2024-04-24 06:25 1.5K 
[TXT]fuzz_ldb_parse_tree.c2024-04-24 06:25 1.3K 
[TXT]fuzz_lzxpress.c2024-04-24 06:25 1.0K 
[TXT]fuzz_lzxpress_compress.c2024-04-24 06:25 1.0K 
[TXT]fuzz_lzxpress_huffman_compress.c2024-04-24 06:25 1.6K 
[TXT]fuzz_lzxpress_huffman_decompress.c2024-04-24 06:25 1.3K 
[TXT]fuzz_lzxpress_huffman_round_trip.c2024-04-24 06:25 1.7K 
[TXT]fuzz_lzxpress_round_trip.c2024-04-24 06:25 1.5K 
[TXT]fuzz_ndr_X.c2024-04-24 06:25 7.9K 
[TXT]fuzz_nmblib_parse_packet.c2024-04-24 06:25 1.5K 
[TXT]fuzz_oLschema2ldif.c2024-04-24 06:25 1.6K 
[TXT]fuzz_parse_lpq_entry.c2024-04-24 06:25 1.6K 
[TXT]fuzz_reg_parse.c2024-04-24 06:25 1.2K 
[TXT]fuzz_regfio.c2024-04-24 06:25 1.6K 
[TXT]fuzz_sddl_access_check.c2024-04-24 06:25 5.1K 
[TXT]fuzz_sddl_conditional_ace.c2024-04-24 06:25 2.7K 
[TXT]fuzz_sddl_parse.c2024-04-24 06:25 3.0K 
[TXT]fuzz_security_token_vs_descriptor.c2024-04-24 06:25 1.9K 
[TXT]fuzz_sess_crypt_blob.c2024-04-24 06:25 1.4K 
[TXT]fuzz_stable_sort.c2024-04-24 06:25 1.8K 
[TXT]fuzz_stable_sort_r.c2024-04-24 06:25 1.6K 
[TXT]fuzz_tiniparser.c2024-04-24 06:25 1.2K 
[TXT]fuzzing.c2024-04-24 06:25 804  
[TXT]fuzzing.h2024-04-24 06:25 1.0K 
[DIR]oss-fuzz/2024-04-24 06:25 -  
[DIR]patches/2024-04-24 06:25 -  
[   ]wscript_build2024-04-24 06:25 8.4K 

# Fuzzing Samba

See also https://wiki.samba.org/index.php/Fuzzing

Fuzzing supplies valid, invalid, unexpected or random data as input to a piece
of code. Instrumentation, usually compiler-implemented, is used to monitor for
exceptions such as crashes, assertions or memory corruption.

See [Wikipedia article on fuzzing](https://en.wikipedia.org/wiki/Fuzzing) for
more information.

# Honggfuzz

## Configure with fuzzing

Example command line to build binaries for use with
[honggfuzz](https://github.com/google/honggfuzz/):

```sh
./configure -C --without-gettext --enable-debug --enable-developer \
	--address-sanitizer --enable-libfuzzer --abi-check-disable \
	CC=.../honggfuzz/hfuzz_cc/hfuzz-clang \
	LINK_CC=.../honggfuzz/hfuzz_cc/hfuzz-clang
```


## Fuzzing tiniparser

Example for fuzzing `tiniparser` using `honggfuzz` (see `--help` for more
options):

```sh
make bin/fuzz_tiniparser && \
.../honggfuzz/honggfuzz --sanitizers --timeout 3 --max_file_size 256 \
  --rlimit_rss 100 -f .../tiniparser-corpus -- bin/fuzz_tiniparser
```

# AFL (american fuzzy lop)

## Configure with fuzzing

Example command line to build binaries for use with
[afl](http://lcamtuf.coredump.cx/afl/)

```sh
./configure -C --without-gettext --enable-debug --enable-developer \
	--enable-afl-fuzzer --abi-check-disable \
	CC=afl-gcc
```

## Fuzzing tiniparser

Example for fuzzing `tiniparser` using `afl-fuzz` (see `--help` for more
options):

```sh
make bin/fuzz_tiniparser build && \
afl-fuzz -m 200 -i inputdir -o outputdir -- bin/fuzz_tiniparser
```

# oss-fuzz

Samba can be fuzzed by Google's oss-fuzz system.  Assuming you have an
oss-fuzz checkout from https://github.com/google/oss-fuzz with Samba's
metadata in projects/samba, the following guides will help:

## Testing locally

https://google.github.io/oss-fuzz/getting-started/new-project-guide/#testing-locally

## Debugging oss-fuzz

See https://google.github.io/oss-fuzz/advanced-topics/debugging/

## Samba-specific hints

A typical debugging workflow is:

oss-fuzz$ python infra/helper.py shell samba
git fetch $REMOTE $BRANCH
git checkout FETCH_HEAD
lib/fuzzing/oss-fuzz/build_image.sh
compile

This will pull in any new Samba deps and build Samba's fuzzers.

# vim: set sw=8 sts=8 ts=8 tw=79 :