Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Issue 1156103003: Initial implementation of a record-level bitcode fuzzer. (Closed)

Created:
5 years, 6 months ago by Karl
Modified:
5 years, 6 months ago
CC:
native-client-reviews_googlegroups.com, aarya
Base URL:
https://chromium.googlesource.com/native_client/pnacl-llvm.git@fuzz
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Initial implementation of a record-level bitcode fuzzer. Initial implementation of a record-level bitcod fuzzer for PNaCl bitcode files. Uses "rand" for the random number generator, as well as some simplistic rules for generating values for the bitcode records. The simplistic rules use lists of weighted values, and values are chosen from the list based on the corresponding weighted distribution. Also fixes minor bug in the bitstream writer where no checks were applied to see if an abbreviation definition was outside any scope. BUG=https://code.google.com/p/nativeclient/issues/detail?id=4169 R=jvoung@chromium.org Committed: https://chromium.googlesource.com/native_client/pnacl-llvm/+/4dd3b8a933b8eb4fa65ee21051e6e48cfdbdb4bf

Patch Set 1 #

Patch Set 2 : Fix upload issues. #

Patch Set 3 : Fix nits. #

Total comments: 8

Patch Set 4 : Fix issues raised in patch set 3. #

Patch Set 5 : Fix nits. #

Total comments: 64

Patch Set 6 : Fix issues in patch set 5. #

Patch Set 7 : Fix nit. #

Total comments: 10

Patch Set 8 : Fix issues in last patch #

Total comments: 22

Patch Set 9 : Fix issues in last patch. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+947 lines, -15 lines) Patch
M include/llvm/Bitcode/NaCl/NaClBitcodeMungeUtils.h View 1 1 chunk +3 lines, -1 line 0 comments Download
A include/llvm/Bitcode/NaCl/NaClFuzz.h View 1 2 3 4 5 6 7 8 1 chunk +94 lines, -0 lines 0 comments Download
A include/llvm/Bitcode/NaCl/NaClRandNumGen.h View 1 2 3 4 5 1 chunk +64 lines, -0 lines 0 comments Download
M lib/Bitcode/NaCl/TestUtils/CMakeLists.txt View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
A lib/Bitcode/NaCl/TestUtils/NaClFuzz.cpp View 1 2 3 4 5 6 7 8 1 chunk +53 lines, -0 lines 0 comments Download
A lib/Bitcode/NaCl/TestUtils/NaClRandNumGen.cpp View 1 2 3 4 5 1 chunk +44 lines, -0 lines 0 comments Download
A lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp View 1 2 3 4 5 6 7 8 1 chunk +496 lines, -0 lines 0 comments Download
M tools/CMakeLists.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M tools/LLVMBuild.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tools/Makefile View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
A + tools/pnacl-bcfuzz/CMakeLists.txt View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -4 lines 0 comments Download
A + tools/pnacl-bcfuzz/LLVMBuild.txt View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -4 lines 0 comments Download
A + tools/pnacl-bcfuzz/Makefile View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
A tools/pnacl-bcfuzz/pnacl-bcfuzz.cpp View 1 2 3 4 5 6 7 8 1 chunk +176 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (3 generated)
Karl
This is the initial implementation of fuzzing PNaCl bitcode records. Please review. Thanks.
5 years, 6 months ago (2015-05-26 17:31:49 UTC) #2
Martin Barbella
https://codereview.chromium.org/1156103003/diff/40001/lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp File lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp (right): https://codereview.chromium.org/1156103003/diff/40001/lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp#newcode315 lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp:315: if (Bitcode.getBaseRecords().size() > RAND_MAX) What sort of sizes are ...
5 years, 6 months ago (2015-05-26 20:06:41 UTC) #4
kcc2
https://codereview.chromium.org/1156103003/diff/40001/include/llvm/Bitcode/NaCl/NaClFuzz.h File include/llvm/Bitcode/NaCl/NaClFuzz.h (right): https://codereview.chromium.org/1156103003/diff/40001/include/llvm/Bitcode/NaCl/NaClFuzz.h#newcode54 include/llvm/Bitcode/NaCl/NaClFuzz.h:54: /// \brief Generates a new fuzzing of the bitcode, ...
5 years, 6 months ago (2015-05-26 20:38:32 UTC) #6
Karl
https://codereview.chromium.org/1156103003/diff/40001/lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp File lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp (right): https://codereview.chromium.org/1156103003/diff/40001/lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp#newcode315 lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp:315: if (Bitcode.getBaseRecords().size() > RAND_MAX) On 2015/05/26 20:06:41, mbarbella wrote: ...
5 years, 6 months ago (2015-05-26 20:39:21 UTC) #7
Martin Barbella
On 2015/05/26 20:39:21, Karl wrote: > https://codereview.chromium.org/1156103003/diff/40001/lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp > File lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp (right): > > https://codereview.chromium.org/1156103003/diff/40001/lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp#newcode315 > ...
5 years, 6 months ago (2015-05-26 20:42:09 UTC) #8
jvoung (off chromium)
https://codereview.chromium.org/1156103003/diff/40001/lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp File lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp (right): https://codereview.chromium.org/1156103003/diff/40001/lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp#newcode315 lib/Bitcode/NaCl/TestUtils/NaClSimpleRecordFuzzer.cpp:315: if (Bitcode.getBaseRecords().size() > RAND_MAX) On 2015/05/26 20:39:21, Karl wrote: ...
5 years, 6 months ago (2015-05-26 20:43:14 UTC) #9
Karl
https://codereview.chromium.org/1156103003/diff/40001/include/llvm/Bitcode/NaCl/NaClFuzz.h File include/llvm/Bitcode/NaCl/NaClFuzz.h (right): https://codereview.chromium.org/1156103003/diff/40001/include/llvm/Bitcode/NaCl/NaClFuzz.h#newcode54 include/llvm/Bitcode/NaCl/NaClFuzz.h:54: /// \brief Generates a new fuzzing of the bitcode, ...
5 years, 6 months ago (2015-05-29 20:59:34 UTC) #10
jvoung (off chromium)
https://codereview.chromium.org/1156103003/diff/80001/include/llvm/Bitcode/NaCl/NaClFuzz.h File include/llvm/Bitcode/NaCl/NaClFuzz.h (right): https://codereview.chromium.org/1156103003/diff/80001/include/llvm/Bitcode/NaCl/NaClFuzz.h#newcode13 include/llvm/Bitcode/NaCl/NaClFuzz.h:13: // number generator. As a result, this code is ...
5 years, 6 months ago (2015-06-01 17:26:36 UTC) #11
Karl
https://codereview.chromium.org/1156103003/diff/80001/include/llvm/Bitcode/NaCl/NaClFuzz.h File include/llvm/Bitcode/NaCl/NaClFuzz.h (right): https://codereview.chromium.org/1156103003/diff/80001/include/llvm/Bitcode/NaCl/NaClFuzz.h#newcode13 include/llvm/Bitcode/NaCl/NaClFuzz.h:13: // number generator. As a result, this code is ...
5 years, 6 months ago (2015-06-01 22:40:56 UTC) #12
jvoung (off chromium)
https://codereview.chromium.org/1156103003/diff/120001/tools/pnacl-bcfuzz/CMakeLists.txt File tools/pnacl-bcfuzz/CMakeLists.txt (right): https://codereview.chromium.org/1156103003/diff/120001/tools/pnacl-bcfuzz/CMakeLists.txt#newcode2 tools/pnacl-bcfuzz/CMakeLists.txt:2: BitWriter NaClBitWriter ? https://codereview.chromium.org/1156103003/diff/120001/tools/pnacl-bcfuzz/pnacl-bcfuzz.cpp File tools/pnacl-bcfuzz/pnacl-bcfuzz.cpp (right): https://codereview.chromium.org/1156103003/diff/120001/tools/pnacl-bcfuzz/pnacl-bcfuzz.cpp#newcode69 tools/pnacl-bcfuzz/pnacl-bcfuzz.cpp:69: ...
5 years, 6 months ago (2015-06-02 00:32:06 UTC) #13
Karl
https://codereview.chromium.org/1156103003/diff/120001/tools/pnacl-bcfuzz/CMakeLists.txt File tools/pnacl-bcfuzz/CMakeLists.txt (right): https://codereview.chromium.org/1156103003/diff/120001/tools/pnacl-bcfuzz/CMakeLists.txt#newcode2 tools/pnacl-bcfuzz/CMakeLists.txt:2: BitWriter On 2015/06/02 00:32:06, jvoung wrote: > NaClBitWriter ? ...
5 years, 6 months ago (2015-06-02 15:42:32 UTC) #14
jvoung (off chromium)
https://codereview.chromium.org/1156103003/diff/140001/include/llvm/Bitcode/NaCl/NaClFuzz.h File include/llvm/Bitcode/NaCl/NaClFuzz.h (right): https://codereview.chromium.org/1156103003/diff/140001/include/llvm/Bitcode/NaCl/NaClFuzz.h#newcode24 include/llvm/Bitcode/NaCl/NaClFuzz.h:24: #include <random> llvm/Bitcode/NaCl/NaClRandNumGen.h already includes <random> https://codereview.chromium.org/1156103003/diff/140001/lib/Bitcode/NaCl/TestUtils/NaClFuzz.cpp File lib/Bitcode/NaCl/TestUtils/NaClFuzz.cpp ...
5 years, 6 months ago (2015-06-02 16:14:03 UTC) #15
Karl
https://codereview.chromium.org/1156103003/diff/140001/include/llvm/Bitcode/NaCl/NaClFuzz.h File include/llvm/Bitcode/NaCl/NaClFuzz.h (right): https://codereview.chromium.org/1156103003/diff/140001/include/llvm/Bitcode/NaCl/NaClFuzz.h#newcode24 include/llvm/Bitcode/NaCl/NaClFuzz.h:24: #include <random> On 2015/06/02 16:14:03, jvoung wrote: > llvm/Bitcode/NaCl/NaClRandNumGen.h ...
5 years, 6 months ago (2015-06-02 16:40:23 UTC) #16
jvoung (off chromium)
lgtm
5 years, 6 months ago (2015-06-02 16:47:21 UTC) #17
Karl
5 years, 6 months ago (2015-06-02 16:53:36 UTC) #18
Message was sent while issue was closed.
Committed patchset #9 (id:160001) manually as
4dd3b8a933b8eb4fa65ee21051e6e48cfdbdb4bf (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698