Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libFuzzer to llvm/llvm-project@60e32a1 #89

Merged
merged 4 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ pushd ./example
cargo rustc \
--release \
-- \
-Cpasses='sancov' \
-Ccodegen-units=1 \
-Cpasses=sancov-module \
-Cllvm-args=-sanitizer-coverage-level=3 \
-Cllvm-args=-sanitizer-coverage-trace-compares \
-Cllvm-args=-sanitizer-coverage-inline-8bit-counters \
Expand All @@ -26,7 +27,8 @@ pushd ./example_arbitrary
cargo rustc \
--release \
-- \
-Cpasses='sancov' \
-Ccodegen-units=1 \
-Cpasses=sancov-module \
-Cllvm-args=-sanitizer-coverage-level=3 \
-Cllvm-args=-sanitizer-coverage-trace-compares \
-Cllvm-args=-sanitizer-coverage-inline-8bit-counters \
Expand All @@ -46,7 +48,8 @@ pushd ./example_mutator
cargo rustc \
--release \
-- \
-Cpasses='sancov' \
-Ccodegen-units=1 \
-Cpasses=sancov-module \
-Cllvm-args=-sanitizer-coverage-level=3 \
-Cllvm-args=-sanitizer-coverage-trace-compares \
-Cllvm-args=-sanitizer-coverage-inline-8bit-counters \
Expand Down
2 changes: 1 addition & 1 deletion example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
if data == b"banana!" {
if data == "banana!".as_bytes() {
panic!("success!");
}
});
1 change: 1 addition & 0 deletions libfuzzer/FuzzerInterceptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
}

#include <cassert>
#include <cstddef> // for size_t
#include <cstdint>
#include <dlfcn.h> // for dlsym()

Expand Down
6 changes: 2 additions & 4 deletions libfuzzer/dataflow/DataFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
// and also provides basic-block coverage for every input.
//
// Build:
// 1. Compile this file (DataFlow.cpp) with -fsanitize=dataflow -mllvm
// -dfsan-fast-16-labels and -O2.
// 1. Compile this file (DataFlow.cpp) with -fsanitize=dataflow and -O2.
// 2. Compile DataFlowCallbacks.cpp with -O2 -fPIC.
// 3. Build the fuzz target with -g -fsanitize=dataflow
// -mllvm -dfsan-fast-16-labels
// -fsanitize-coverage=trace-pc-guard,pc-table,bb,trace-cmp
// 4. Link those together with -fsanitize=dataflow
//
Expand Down Expand Up @@ -82,7 +80,7 @@ static inline bool BlockIsEntry(size_t BlockIdx) {
return __dft.PCsBeg[BlockIdx * 2 + 1] & PCFLAG_FUNC_ENTRY;
}

const int kNumLabels = 16;
const int kNumLabels = 8;

// Prints all instrumented functions.
static int PrintFunctions() {
Expand Down