Commit Graph

181 Commits

Author SHA1 Message Date
71a16f0239 Add new fuzzer libwget_cookie_fuzzer
* fuzz/Makefile.am: Add libwget_cookie_fuzzer
* fuzz/libwget_cookie_fuzzer.c: New fuzzer
* fuzz/libwget_cookie_fuzzer.in/*: Corpora
* fuzz/run-clang.sh: Add -lpsl and -lgnutls
2017-06-18 20:39:23 +02:00
1653c62fea Add new fuzzer libwget_base64_fuzzer
* fuzz/Makefile.am: Add libwget_base64_fuzzer
* fuzz/libwget_base64_fuzzer.c: New fuzzer
* fuzz/libwget_base64_fuzzer.in/*: Corpora
2017-06-17 21:39:41 +02:00
acd1037f09 Increase fuzz coverage for bar.c and rss_url.c
* fuzz/libwget_atom_url_fuzzer.c: Add RSS parsing
* fuzz/libwget_atom_url_fuzzer.dict: Add RSS tags
* fuzz/libwget_bar_fuzzer.c: Increase fuzz code coverage
* fuzz/*.in/*: Update corpora
2017-06-17 20:30:04 +02:00
32e97a0067 Add new fuzzer libwget_iri_fuzzer
* fuzz/Makefile.am: Add libwget_sitemap_url_fuzzer
* fuzz/libwget_iri_fuzzer.c: New fuzzer
* fuzz/libwget_iri_fuzzer.dict: New dictionary
* fuzz/libwget_iri_fuzzer.in/*: Corpora
2017-06-16 12:44:33 +02:00
f1e954757a Add new fuzzer libwget_sitemap_url_fuzzer
* fuzz/Makefile.am: Add libwget_sitemap_url_fuzzer
* fuzz/libwget_sitemap_url_fuzzer.c: New fuzzer
* fuzz/libwget_sitemap_url_fuzzer.dict: New dictionary
* fuzz/libwget_sitemap_url_fuzzer.in/*: Corpora
* fuzz/run-clang.sh: Add -jobs and -workers
2017-06-15 21:21:16 +02:00
be4a6d338a Add new fuzzer libwget_css_url_fuzzer
* fuzz/Makefile.am: Add libwget_css_url_fuzzer
* fuzz/libwget_css_url_fuzzer.c: New fuzzer
* fuzz/libwget_css_url_fuzzer.dict: New dictionary
* fuzz/libwget_css_url_fuzzer.in/*: Corpora
2017-06-14 21:26:17 +02:00
d547bb7f23 * fuzz/libwget_atom_url_fuzzer.dict: Remove empty line at EOF 2017-06-14 21:23:54 +02:00
eb908421f6 Add new fuzzer libwget_atom_url_fuzzer
* fuzz/Makefile.am: Add libwget_atom_url_fuzzer
* fuzz/libwget_atom_url_fuzzer.c: New fuzzer
* fuzz/libwget_atom_url_fuzzer.dict: New dictionary
* fuzz/libwget_atom_url_fuzzer.in/*: Corpora
2017-06-14 17:00:22 +02:00
b763191c6d Add fuzz corpora from OSS-Fuzz
* *.in/*: New copora
* run-clang.sh: Add needed libraries to fuzzer executables (regression)
2017-06-14 17:00:22 +02:00
b3e7b830e7 Fix integer overflow in metalink code found by OSS-Fuzz
* fuzz/libwget_metalink_parse_fuzzer.repro/5268760606801920:
  Reproducer from oss-fuzz
* libwget/metalink.c (_add_piece): Avoid integer overflow
2017-06-10 22:59:34 +02:00
4c355e9eab * fuzz/fuzzer.h: Add extern 'C' 2017-06-09 17:12:16 +02:00
568ab285ed * fuzz/README.md: Add code coverage section 2017-06-09 12:21:55 +02:00
61ffd8afb0 * fuzz/Makefile.am: Add clean-local make target 2017-06-09 12:21:00 +02:00
b70e9bd34b Increase fuzz coverage of wget_metalink_parse()
* libwget_metalink_parse_fuzzer.c: Call wget_metalink_sort_mirrors()
* libwget_metalink_parse_fuzzer.dict: Add keywords
* libwget_metalink_parse_fuzzer.in/xml1: Add content
2017-06-08 17:14:44 +02:00
6b2642a553 Add script for fast checking of fuzz coverage
* fuzz/view-coverage.sh: New helper script
2017-06-08 16:23:56 +02:00
97ac21bf78 Add more fuzz corpora for wget_xml_parse_buffer()
* fuzz/libwget_xml_parse_buffer_fuzzer.in/*: New files
2017-06-08 16:21:27 +02:00
6ddcfa5261 Increase fuzz coverage for wget_xml_parse_buffer()
* libwget_xml_parse_buffer_fuzzer.c: Increase fuzz coverage
* libwget_xml_parse_buffer_fuzzer.dict: Add 'style' keyword
2017-06-08 16:18:06 +02:00
98a8b90f3b Use C instead of C++ for fuzzer targets
* configure.ac: Remove AC_PROG_CXX
* fuzz/Makefile.am: Amend *_SOURCES for .c fuzzer targets,
  Remove non-portable EXTRA_DIST wildcards,
  Add dist-hook to include fuzzer target files,
  Add oss-fuzz make target.
* fuzz/fuzzer.h: New file
* fuzz/*cc: Rename to C, include fuzzer.h
* fuzz/main.c: Include fuzzer.h
* fuzz/run-clang.sh: Build and run fuzzer targets made with clang/libFuzzer
2017-06-08 12:37:28 +02:00
6839e26440 * fuzz/Makefile.am: Add test corpora to tarball 2017-06-06 16:03:41 +02:00
5612f76377 Add OSS-Fuzz reproducers to test suite
* cfg.mk: Exclude *.repro/* from syntax-check
* fuzz/Makefile.am: Add *.repro/* to EXTRA_DIST
* fuzz/libwget_metalink_parse_fuzzer.repro/clusterfuzz-testcase-minimized-5103826937839616:
    Reproducer for OSS-Fuzz issue #1915
* fuzz/libwget_xml_parse_buffer_fuzzer.repro/clusterfuzz-testcase-minimized-4704516446355456:
    Reproducer for OSS-Fuzz issue #2041
* fuzz/main.c: Scan and test all files from *.repro/
2017-06-04 21:10:17 +02:00
caa7a5b541 * fuzz/Makefile.am: Remove lib/ from include directories 2017-06-03 22:05:32 +02:00
68fd51e568 Use fuzz targets as unit tests for 'make check'
* Makefile.am: Add 'fuzz' directory to SUBDIRS,
  tune 'fuzz-coverage' make target,
  print info on how to view coverage report.
* configure.ac: Add AC_PROG_CXX for C++ code in fuzz/
* fuzz/Makefile: Removed
* fuzz/Makefile.am: New file
* fuzz/libwget_bar_fuzzer.cc: Fix memleak
* fuzz/main.c: Add code for unit testing

The OSS-Fuzz targets will now be taken for unit testing as well.

That is, they will be tested by 'make check' including our sanitizer
and valgrind checks. The fuzz tests will be run once with each test
corpus from the corresponding '.in' directory.

A 'make fuzz-coverage' generates a coverage report for running all
fuzz targets against their corpora.
2017-06-02 21:14:45 +02:00
069c260f8a * fuzz/libwget_memtohex_fuzzer.cc: Add two test vectors 2017-06-01 17:06:57 +02:00
7633bc9810 Add make target 'fuzz-coverage'
* Makefile.am: Add target 'fuzz-coverage' to generate a coverage
  report for fuzz targets.
* fuzz/Makefile: Add target 'fuzz-coverage'
* fuzz/coverage.sh: New script to call a fuzz target with each corpus.
* fuzz/libwget_metalink_parse_fuzzer.cc: Add check for max input length.
* fuzz/libwget_xml_parse_buffer_fuzzer.cc: Likewise
* fuzz/libwget_robots_parse_fuzzer.cc: Add comment
* fuzz/libwget_robots_parse_fuzzer.in/user_agent2: Amend for max coverage
* fuzz/main.c: selfmade __AFL_LOOP() returns 0 after first invocation.
* fuzz/libwget_memtohex.in: Rename to fuzz/libwget_memtohex_fuzzer.in
* fuzz/libwget_metalink_parse.in: Rename to fuzz/libwget_metalink_parse_fuzzer.in
* fuzz/libwget_robots_parse.in: Rename to fuzz/libwget_robots_parse_fuzzer.in
* fuzz/libwget_xml_parse_buffer.in: Rename to fuzz/libwget_xml_parse_buffer_fuzzer.in
* fuzz/libwget_xml_parse_buffer.options: Removed
* fuzz/libwget_metalink_parse_fuzzer.options: Removed
2017-06-01 17:06:57 +02:00
ab1803f91c Enhance fuzz code
* fuzz/*_fuzzer.cc: Use malloc() instead of stack memory to help
  sanitizers.
* fuzz/libwget_robots_parse.in/user_agent1: Increase code coverage.
* fuzz/main.c: define __AFL_LOOP() is not already defined.
2017-05-31 17:06:22 +02:00
4c21d5e903 Add two fuzz corpora
* fuzz/libwget_metalink_parse.in/tag1: New file
* fuzz/libwget_xml_parse_buffer.in/tag1: New file
2017-05-30 13:41:59 +02:00
0b50e004ac Fix fuzz minimizing command
* fuzz/README.md: Fix build recipe
* fuzz/run-afl.sh: Fix check whether to call afl-tmin
2017-05-30 13:10:01 +02:00
f1f8e0431d * fuzz/Makefile: Forgot to add to repo 2017-05-30 09:06:17 +02:00
110b071356 Add *.options files to fuzzer
* fuzz/libwget_metalink_parse.options: New file
* fuzz/libwget_xml_parse_buffer.options: New file

Max input len is 64 for OSS-Fuzz, we need larger input for
some fuzz targets.
2017-05-29 17:03:11 +02:00
1868fa0311 Enhance fuzzing
* cfg.mk: Let make-syntax-check survive
* fuzz/libwget_metalink_parse.dict: New dictionary
* fuzz/libwget_robots_parse.dict: New dictionary
* fuzz/libwget_xml_parse_buffer.dict: New dictionary
* fuzz/libwget_robots_parse.in/disallowed1: Obsolete by afl-cmin
* fuzz/libwget_robots_parse.in/user_agent3: Likewise
* fuzz/libwget_xml_parse_buffer.in/index.html: Removed redundant HTML tags
* fuzz/run-afl.sh: Auto-optimize corpora with afl-tmin
2017-05-29 12:41:03 +02:00
8e2fecc6ff Add initial fuzzing code
* fuzz/*: New files

README.md contains instructions how to build and run single fuzzers.
Currently we have fuzzers and corpora for
  - wget_memtohex()
  - wget_metalink_parse()
  - wget_robots_parse()
  - wget_xml_parse_buffer()

* fuzz/libwget_bar.in/123456: New file
2017-05-29 10:10:47 +02:00