diff options
author | Matt Morehouse <mascasa@google.com> | 2019-05-09 22:48:46 +0000 |
---|---|---|
committer | Matt Morehouse <mascasa@google.com> | 2019-05-09 22:48:46 +0000 |
commit | 8d9c46f942cd628947f4209bedc0a2f47115ec31 (patch) | |
tree | a019a5defb0756cf328e9da0051913897bb89337 /lib/fuzzer/FuzzerLoop.cpp | |
parent | 87743d8a94e5b8a2f08d5345b27326b8fcb80d9e (diff) | |
download | compiler-rt-8d9c46f942cd628947f4209bedc0a2f47115ec31.tar.gz |
[libFuzzer] Unpoison parameters before calling user callback.
Summary:
Fixes an MSan false positive when compiling with
-fsanitize=memory,fuzzer.
See https://github.com/google/oss-fuzz/issues/2369 for more details.
Reviewers: kcc
Reviewed By: kcc
Subscribers: llvm-commits, metzman, eugenis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61753
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@360390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/FuzzerLoop.cpp')
-rw-r--r-- | lib/fuzzer/FuzzerLoop.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fuzzer/FuzzerLoop.cpp b/lib/fuzzer/FuzzerLoop.cpp index d1ad3e37e..cb3d8214c 100644 --- a/lib/fuzzer/FuzzerLoop.cpp +++ b/lib/fuzzer/FuzzerLoop.cpp @@ -542,6 +542,8 @@ void Fuzzer::ExecuteCallback(const uint8_t *Data, size_t Size) { memcpy(DataCopy, Data, Size); if (EF->__msan_unpoison) EF->__msan_unpoison(DataCopy, Size); + if (EF->__msan_unpoison_param) + EF->__msan_unpoison_param(2); if (CurrentUnitData && CurrentUnitData != Data) memcpy(CurrentUnitData, Data, Size); CurrentUnitSize = Size; @@ -702,7 +704,7 @@ void Fuzzer::MutateAndTestOne() { break; // We will mutate this input more in the next rounds. } if (Options.ReduceDepth && !FoundUniqFeatures) - break; + break; } } |