summaryrefslogtreecommitdiff
path: root/lib/fuzzing/wscript_build
Commit message (Collapse)AuthorAgeFilesLines
* lib/fuzzing: add fuzzer for sddl_parseDouglas Bagnall2023-04-281-0/+5
| | | | | | | | | Apart from catching crashes in the actual parsing, we abort if the SD we end up with will not round trip back through SDDL to an identical SD. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* fuzz: add fuzz_lzxpress_huffman_round_tripDouglas Bagnall2022-12-011-0/+5
| | | | | | | | This compresses some data, decompresses it, and asserts that the result is identical to the original string. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* fuzz: add fuzz_lzxpress_huffman_compressDouglas Bagnall2022-12-011-0/+5
| | | | | | | | | This differs from fuzz_lzxpress_huffman_round_trip (next commit) in that the output buffer might be too small for the compressed data, in which case we want to see an error and not a crash. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* fuzz: add fuzz_lzxpress_huffman_decompressDouglas Bagnall2022-12-011-0/+5
| | | | | | | | Most strings will not successfully decompress, which is OK. What we care about of course is memory safety. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* fuzz: add fuzzers for stable_sortDouglas Bagnall2022-12-011-0/+10
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* fuzz: add lzxpress compress/decompress round-tripDouglas Bagnall2022-05-121-0/+5
| | | | | | | We say it is an error to end up at a different result. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* fuzz: add fuzz_lzxpress_compressDouglas Bagnall2022-05-121-0/+5
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpc_server: Activate samba-dcerpcdVolker Lendecke2021-12-101-1/+1
| | | | | | | | | | | | | | This is the big switch to use samba-dcerpcd for the RPC services in source3/. It is a pretty big and unordered patch, but I don't see a good way to split this up into more manageable pieces without sacrificing bisectability even more. Probably I could cut out a few small ones, but a major architechtural switch like this will always be messy. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* fuzz: add fuzz_parse_lpq_entryDouglas Bagnall2021-07-051-0/+5
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* fuzz: add fuzz_cli_credentials_parse_stringDouglas Bagnall2020-10-161-0/+5
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* fuzz: add fuzz_dcerpc_parse_bindingDouglas Bagnall2020-10-161-0/+5
| | | | | | | | We parse a binding and do a few tricks with it, including turning it into a tower and back. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* fuzz: add nmblib/parse_packet targetDouglas Bagnall2020-01-151-0/+5
| | | | | | | | | | | | We want to ensure that parse_packet() can parse a packet without crashing, and that that parsed packet won't cause trouble further down the line. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Wed Jan 15 21:24:31 UTC 2020 on sn-devel-184
* fuzz: ldb binary decode/enodeDouglas Bagnall2020-01-151-0/+5
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* fuzz: add ldb ldif fuzzerDouglas Bagnall2020-01-151-0/+5
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* fuzz: ldb_dn parsingDouglas Bagnall2020-01-151-0/+5
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* fuzz: add a fuzzer for parsing ldb controlsDouglas Bagnall2020-01-121-0/+5
| | | | | | | | | | We have had issues here in the past. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sun Jan 12 21:21:30 UTC 2020 on sn-devel-184
* lib/fuzzing and librpc: Do not generate fuzzers for pointless targetsAndrew Bartlett2019-12-181-3/+0
| | | | | | | | | We need to focus the fuzzing effort on reachable code, and these IDL are just historical artifacts, many are entirely [todo] and have no samba client nor server. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* lib/fuzzing: Split up automatically build fuzzers into TYPE_{IN,OUT,STRUCT}Andrew Bartlett2019-12-111-3/+5
| | | | | | | | | | | | The advise is that a fuzz target should be as small as possible so we split this up. Splitting up by function would build too many fuzzers, but this should help a little. See for example: https://github.com/google/fuzzing/blob/master/docs/good-fuzz-target.md#large-apis Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@samba.org>
* lib/fuzzing: Add mode for the AFL fuzzerAndrew Bartlett2019-12-101-12/+16
| | | | | | | | This is helpful for ensuring the fuzzers still compile in autobuild as no library support is required. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/fuzzer: Allow building a fuzz binary for just one interfaceAndrew Bartlett2019-12-101-4/+22
| | | | | | | This helps direct the fuzzer at a particular function that we are concerned about. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/fuzzer: Remove rudundent install=False flag from fuzz_ndr_X build ruleAndrew Bartlett2019-12-101-1/+0
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/fuzzing: Link only the required NDR_ subsystems into ndr_fuzz_X binariesAndrew Bartlett2019-12-101-2/+7
| | | | | | | | | This reduces the binary size and shows that we are linked against the correct ndr_table_ global variable. This might help the fuzzing engine know there is not much more of the binary to find if unreachable code is not included. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/fuzzing: add fuzz_ndr_XDouglas Bagnall2019-12-101-0/+80
| | | | | | | | | | | | | | | | | | This NDR fuzzer links with each "interface" in the IDL files to create avsingle binary. This tries to matches what the fuzzing engines desire. It started as a copy of ndrdump but very little of that remains in place. The fancy build rules try to avoid needing a lof of boilerplate in the wscript_build files and ensure new fuzzers are generated and run when new IDL is added automatically. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/fuzzing: Use --fuzz-target-ldflags if specifiedAndrew Bartlett2019-11-201-1/+1
| | | | | | | | | | This makes integration with oss-fuzz possible. Only the fuzzer binaries should be linked with libFuzzer, not things like asn1_compile, so this can not be done via the global ADDITIONAL_LDFLAGS. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Uri Simchoni <uri@samba.org>
* build: Set fuzzer=True on fuzzer binariesDouglas Bagnall2019-11-201-20/+7
| | | | | | | | | This ensures that the binaries are the only binaries built when configured for fuzzing. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add fuzzing binary for ldb_parse_treeMichael Hanselmann2019-10-181-0/+7
| | | | | | Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* Add fuzzing binary for ldap_decodeMichael Hanselmann2019-10-181-0/+7
| | | | | | Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* Add fuzzing binary for lzxpressMichael Hanselmann2019-10-181-0/+7
| | | | | | Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* Add fuzzing binary for regfioMichael Hanselmann2019-10-181-0/+7
| | | | | | | | | Checksums are better ignored during fuzzing, hence a flag is added to the regfio parser to disable checksums. Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* Add fuzzing binary for reg_parseMichael Hanselmann2019-10-181-0/+7
| | | | | | | | A temporary file is used to store the fuzzing input. Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* Add fuzzing binary for oLschema2ldifMichael Hanselmann2019-08-071-0/+7
| | | | | | | | | Use the oLschema2ldif library functions introduced in commit 0c7c44a284a26790081c000f5b8f4ed32f9f21d7 to implement a fuzzing utility. Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* Add fuzzing binary for tiniparserMichael Hanselmann2019-08-071-0/+6
| | | | | | | | | | | The "tiniparser_load" function is made into a wrapper for the newly added "tiniparser_load_stream" function which accepts a FILE pointer. This way no actual files have to be opened for fuzzing (memfd_create(2) isn't readily available on all systems yet). Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* Add fuzzing support to build systemMichael Hanselmann2019-08-071-0/+7
LibFuzzer, Honggfuzz and other programs implement simple interfaces for fuzzing appropriately prepared code. Samba contains quite a lot of parsing code, often a good target for fuzzing. With this change the build system is amended to support building fuzzing binaries (added in later changes). Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>