Commit Graph

137 Commits

Author SHA1 Message Date
Kostya Serebryany
242325ad98 [libFuzzer] add -merge flag to merge corpora
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 01:16:40 +00:00
Kostya Serebryany
b33343ddb1 [libFuzzer] remove some old code; also make __sanitizer_get_total_unique_caller_callee_pairs weak so that newer libFuzzer works with older asan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251133 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 18:37:58 +00:00
Kostya Serebryany
7bcc4cdbdd [libFuzzer] use the indirect caller-callee counter as an independent search heuristic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251078 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 23:55:39 +00:00
Kostya Serebryany
41180c6eba [libFuzzer] more refactoring the code that checks the coverage. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251075 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 22:56:45 +00:00
Kostya Serebryany
1969ec112d [libFuzzer] refactoring the code that checks the coverage. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251074 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 22:50:47 +00:00
Kostya Serebryany
a3619c6b43 [libFuzzer] remove the deprecated 'tokens' feature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251069 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 21:48:09 +00:00
Craig Topper
44bf343ec1 Make a bunch of static arrays const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 05:15:34 +00:00
Kostya Serebryany
2a50aa48db [libFuzzer] add -shuffle flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-17 04:38:26 +00:00
Kostya Serebryany
9b24e29d72 [libFuzzer] print a stack trace on timeout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 23:04:31 +00:00
Kostya Serebryany
5792846506 [libFuzzer] reduce the size of artifacts printed on the screen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250565 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 22:47:20 +00:00
Kostya Serebryany
17062e257e [libFuzzer] When -test_single_input crashes the test it is not necessary to write crash-file because input is already known to the user. Patch by Mike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250564 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 22:41:47 +00:00
Kostya Serebryany
002f1b00d6 [libFuzzer] don't print large artifacts to stderr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249808 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09 04:03:14 +00:00
Kostya Serebryany
22d6013f13 [libFuzzer] add -artifact_prefix flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249807 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09 03:57:59 +00:00
Kostya Serebryany
5cacd53f76 [libFuzzer] fix 32-bit build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-08 00:59:25 +00:00
Kostya Serebryany
2e700c9bf6 [libFuzzer] trying to fix at-exit hang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249231 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-03 07:02:05 +00:00
Kostya Serebryany
9906eefc84 [libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return int instead of void. The actual return value is not *yet* used (and expected to be 0). This change is API breaking, so the fuzzers will need to be updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249214 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 23:34:06 +00:00
Kostya Serebryany
f351bce7bd [libFuzzer] remove experimental flag and functionality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249194 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 22:00:32 +00:00
Kostya Serebryany
cd0d243e72 [libFuzzer] add a flag -max_total_time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 20:47:55 +00:00
Ivan Krasin
55928e792c [LibFuzzer] test_single_input option to run a single test case.
-test_single_input flag specifies a file name with test data.

Review URL: http://reviews.llvm.org/D13359

Patch by Mike Aizatsky!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249096 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01 23:23:06 +00:00
Kostya Serebryany
22e2376e14 [libFuzzer] Marking exported symbols as visible. Patch by Mike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248954 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-30 22:22:37 +00:00
Kostya Serebryany
8a15ef599e [libFuzzer] perform fewer crossover operations compared to plain mutations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 00:20:58 +00:00
Kostya Serebryany
8eaf34eed8 [libFuzzer] refactor the code to allow building libFuzzer on platforms that don't have dfsan and don't support weak functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 18:48:38 +00:00
Kostya Serebryany
a8d8dba0a6 [libFuzzer] add two more variants of FuzzerDriver for convenience
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-10 16:57:57 +00:00
Ivan Krasin
9e01a11e67 [libFuzzer]Add a test for defeating a hash sum.
Summary:
Add a test for a data followed by 4-byte hash value.
I use a slightly modified Jenkins hash function,
as described in https://en.wikipedia.org/wiki/Jenkins_hash_function

The modification is to ensure that hash(zeros) != 0.

Reviewers: kcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12648

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247076 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 21:22:52 +00:00
Kostya Serebryany
88d071c626 [libFuzzer] remove a piece of stale code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247067 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 20:40:10 +00:00
Kostya Serebryany
e96dc98acb [libFuzzer] be more robust when dealing with files on disk (e.g. don't crash if a file was there but disappeared)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247066 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 20:36:33 +00:00
Kostya Serebryany
828d315fd6 [libFuzzer] better documentatio for -save_minimized_corpus=1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247033 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 17:43:51 +00:00
Kostya Serebryany
06465a68cc [libFuzzer] remove -iterations as redundant (there is also -num_runs)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247030 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 17:30:35 +00:00
Kostya Serebryany
872c556fa8 [libFuzzer] add one more mutator: Mutate_ChangeASCIIInteger
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247027 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-08 17:19:31 +00:00
Kostya Serebryany
87e6608466 [libFuzzer] more accurate logic for traces, 80-char fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-04 22:32:25 +00:00
Kostya Serebryany
c18fae603d [libFuzzer] when a single mutation fails try a few more times with other mutations before returning un-mutated data
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246828 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-04 00:40:29 +00:00
Kostya Serebryany
6cc3ed7cdd [libFuzzer] actually make the dictionaries work (+docs)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246825 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-04 00:12:11 +00:00
Kostya Serebryany
bf6bd487d5 [libFuzzer] refactor the mutation functions so that they are now methods of a class. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246808 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-03 21:24:19 +00:00
Kostya Serebryany
446d906a52 [libFuzzer] adding a parser for AFL-style dictionaries + tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246800 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-03 20:23:46 +00:00
Kostya Serebryany
8f6c191d6c [libFuzzer] deprecate the -tokens flag. This was a bad idea because the corpus with this flag contains encrypted inputs, not the real inputs, which complicates interoperation with other fuzzers. Instead we'll need to implement AFL dictionary support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246734 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 23:27:39 +00:00
Kostya Serebryany
580504f120 [libFuzzer] honour -only_ascii=1 when reading the initial corpus. Also, remove ugly #ifdef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246689 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-02 19:08:08 +00:00
Kostya Serebryany
243e7c5f8c [libFuzzer] fix minor inefficiency, PR24584
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246087 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26 21:55:19 +00:00
Lenny Maiorani
5320ef0b60 Fix missing space in libfuzzer's help text.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244800 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 20:00:10 +00:00
Kostya Serebryany
234cfada18 [libFuzzer] add two flags, -tbm_depth and -tbm_width to control how the trace-based-mutations are applied
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244712 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 01:55:37 +00:00
Kostya Serebryany
e0b167c66c [libFuzzer] add colons to the stats output to avoid confusion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 01:04:27 +00:00
Kostya Serebryany
75a2674466 [libFuzzer] use raw C IO to reduce the risk of a deadlock in a signal handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244707 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 00:55:09 +00:00
Nick Lewycky
eacc53d67e Fix unused variable 'X' in release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 05:57:10 +00:00
Kostya Serebryany
89f52ac188 [libFuzzer] add -only_ascii flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244559 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 01:44:42 +00:00
Yaron Keren
b80a26544b Add missing include guard to FuzzerInternal.h, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244457 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 16:37:40 +00:00
Kostya Serebryany
397ed3e704 [libFuzzer] move the mutators to public interface so that custom mutators may reuse these functions directly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244250 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 19:19:55 +00:00
Kostya Serebryany
596885b016 [libFuzzer] add one more mutation strategy: byte shuffling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244188 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 01:29:13 +00:00
Kostya Serebryany
c2f74a9478 [libFuzzer] avoid build warnings in non-assert build (useful warning in this case)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244177 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-05 23:44:42 +00:00
Kostya Serebryany
5707219e94 [libFuzzer] in dfsan mode, set labels every time we start recording traces as opposed to doing it at process startup. This ensures that the labels are fresh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-05 23:02:57 +00:00
Kostya Serebryany
7141424447 [libFuzzer] add option -report_slow_units=Nsec to control when slow units are printed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244152 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-05 21:43:48 +00:00
Kostya Serebryany
764fea6d11 [libFuzzer] add a missing test file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-05 21:32:13 +00:00