diff options
author | Kostya Serebryany <kcc@google.com> | 2015-05-07 00:04:39 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-05-07 00:04:39 +0000 |
commit | 0d1fa9f3440bb80cf016341a5948097533be95fa (patch) | |
tree | b3f20dc462c64a48fb3851f8b29b0d7b43499881 /include | |
parent | 12e289a3b21337ea63845d55d36cf7b3931a0dc0 (diff) |
Add dfsan_weak_hook_memcmp
Summary:
Add a weak hook to be called from dfsan's custom memcmp.
The primary user will be lib/Fuzzer.
If this works well we'll add more hooks (strcmp, etc).
Test Plan: Will be covered by lib/Fuzzer tests.
Reviewers: pcc
Reviewed By: pcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9541
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@236679 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/sanitizer/dfsan_interface.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/sanitizer/dfsan_interface.h b/include/sanitizer/dfsan_interface.h index 79dbf2f36..84ffd49f8 100644 --- a/include/sanitizer/dfsan_interface.h +++ b/include/sanitizer/dfsan_interface.h @@ -91,6 +91,16 @@ void dfsan_set_write_callback(dfsan_write_callback_t labeled_write_callback); /// <label> <parent label 1> <parent label 2> <label description if any> void dfsan_dump_labels(int fd); +/// Whenever a dfsan's custom function is called the corresponding +/// hook is called it non-zero. The hooks should be defined by the user. +/// The primary use case is taint-guided fuzzing, where the fuzzer +/// needs to see the parameters of the function and the labels. +/// FIXME: implement more hooks. + +/// memcmp hook. +void dfsan_weak_hook_memcmp(void *caller_pc, const void *s1, const void *s2, + size_t n, dfsan_label s1_label, + dfsan_label s2_label, dfsan_label n_label); #ifdef __cplusplus } // extern "C" |