summaryrefslogtreecommitdiff
path: root/fuzzers
Commit message (Collapse)AuthorAgeFilesLines
* fuzzers: use system includesEdward Thomson2019-05-191-0/+1
| | | | | | Use the system includes (defined by libgit2) as the fuzzer includes. The fuzzers link against internal libgit2 API and therefore need to have the full include path that libgit2 uses.
* indexer: use git_indexer_progress throughoutEdward Thomson2019-02-221-1/+1
| | | | | Update internal usage of `git_transfer_progress` to `git_indexer_progreses`.
* fuzzers: don't use deprecated typesEdward Thomson2019-01-251-1/+1
|
* errors: remove giterr usage in fuzzersEdward Thomson2019-01-222-2/+2
|
* object_type: convert final internal users to new namesethomson/git_objEdward Thomson2019-01-172-3/+3
| | | | | Update some missed types that were continuing to use the old `GIT_OBJ` names.
* Merge pull request #4845 from pks-t/pks/object-fuzzerCarlos Martín Nieto2018-10-156-0/+439
|\ | | | | Object parsing fuzzer
| * fuzzers: add object parsing fuzzerPatrick Steinhardt2018-10-115-0/+432
| | | | | | | | | | | | Add a simple fuzzer that exercises our object parser code. The fuzzer is quite trivial in that it simply passes the input data directly to `git_object__from_raw` for each of the four object types.
| * fuzzers: initialize libgit2 in standalone driverPatrick Steinhardt2018-10-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The standalone driver for libgit2's fuzzing targets makes use of functions from libgit2 itself. While this is totally fine to do, we need to make sure to always have libgit2 initialized via `git_libgit2_init` before we call out to any of these. While this happens in most cases as we call `LLVMFuzzerInitialize`, which is provided by our fuzzers and which right now always calls `git_libgit2_init`, one exception to this rule is our error path when not enough arguments have been given. In this case, we will call `git_vector_free_deep` without libgit2 having been initialized. As we did not set up our allocation functions in that case, this will lead to a segmentation fault. Fix the issue by always initializing and shutting down libgit2 in the standalone driver. Note that we cannot let this replace the initialization in `LLVMFuzzerInitialize`, as it is required when using the "real" fuzzers by LLVM without our standalone driver. It's no problem to call the initialization and deinitialization functions multiple times, though.
* | Apply code review feedbackNelson Elhage2018-10-111-7/+4
| |
* | fuzzers: Port config_file_fuzzer to the new in-memory backendNelson Elhage2018-10-091-25/+18
|/
* fuzzer: update for indexer changesethomson/fuzzerEdward Thomson2018-08-261-1/+1
|
* Add a proper write loopNelson Elhage2018-08-161-2/+10
|
* Add a copyright header.Nelson Elhage2018-08-141-0/+9
|
* Further review comments, fix the buildNelson Elhage2018-08-141-11/+27
|
* ReformatNelson Elhage2018-08-141-27/+28
|
* Add a config file to the corpusNelson Elhage2018-08-051-0/+11
|
* Add a config file fuzzerNelson Elhage2018-08-051-0/+41
|
* fuzzers: limit maximum pack object countPatrick Steinhardt2018-08-032-0/+7
| | | | | | | | | | | | | By default, libgit2 allows up to 2^32 objects when downloading a packfile from a remote. For each of these objects, libgit2 will allocate up to two small structs, which in total adds up to quite a lot of memory. As a result, our fuzzers might run out of memory rather quick in case where they receive as input a packfile with such a huge count of objects. Limit the packfile object count to 10M objects. This is sufficiently big to still work with most largish repos (linux.git has around 6M objects as of now), but small enough to not cause the fuzzer to OOM.
* fuzzers: convert download_refs fuzzer to CPatrick Steinhardt2018-08-032-156/+208
| | | | | Convert the "download_refs" fuzzer from C++ to C. Rename the source file to have it be picked up by our build system.
* fuzzers: import download_refs fuzzer from oss-fuzzPatrick Steinhardt2018-08-032-0/+156
| | | | | | | | This is a direct copy of the code from google/oss-fuzz, written by Nelson Elhage (@nelhage). Note that due to the ".cc" ending, the file will not yet be picked up by the build system. This is intended, as currently that file is partly written in C++, requiring a conversion to C.
* fuzzers: avoid use of libgit2 internals in packfile_rawPatrick Steinhardt2018-08-031-5/+7
| | | | | | | | | | | | | | | | | | The packfile_raw fuzzer is using some internal APIs from libgit2, which makes it hard to compile it as part of the oss-fuzz project. As oss-fuzz requires us to link against the C++ FuzzingEngine library, we cannot use "-DBUILD_FUZZERS=ON" directly but instead have to first compile an object from our fuzzers and then link against the C++ library. Compiling the fuzzer objects thus requires an external invocation of CC, and we certainly don't want to do further black magic by adding libgit2's private source directory to the header include path. To fix the issue, convert the code to not use any internal APIs. Besides some headers which we have to add now, this also requires us to change to the hashing function of the ODB. Note that this will change the hashing result, as we have previously not prepended the object header to the data that is to be hashed. But this shouldn't matter in practice, as we don't care for the hash value anyway.
* cmake: remove need to add "-fsanitize=fuzzer" flag for fuzzersPatrick Steinhardt2018-08-031-0/+4
| | | | | | | | Right now, users are being instrucded to add the "-DCMAKE_EXE_LINKER_FLAGS=-fsanitize=fuzzer" flag when they want to build our fuzzers. This is error-prone and user unfriendly. Instead, just add the flag to our fuzzers' build instructions so that it happens automatically. Adjust the README accordingly.
* cmake: use C90 standard for our fuzzing targetsPatrick Steinhardt2018-08-031-0/+1
| | | | | | Like all our other internal code, we want to force the use of C90 for our fuzzers. Do so by setting the "C_STANDARD" property of our fuzzing targets.
* fuzzers: move readme to docs/fuzzing.mdPatrick Steinhardt2018-08-031-73/+0
|
* fuzzers: rename "fuzz" directory to match our stylePatrick Steinhardt2018-08-03318-0/+332
Our layout uses names like "examples" or "tests" which is why the "fuzz" directory doesn't really fit in here. Rename the directory to be called "fuzzers" instead. Furthermore, we rename the fuzzer "fuzz_packfile_raw" to "packfile_raw_fuzzer", which is also in line with the already existing fuzzer at google/oss-fuzz. While at it, rename the "packfile_raw" fuzzer to instead just be called "packfile" fuzzer.