summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-07-30 01:19:17 +0000
committerKostya Serebryany <kcc@google.com>2015-07-30 01:19:17 +0000
commit9f881e0fa886c9aa2faa88247d975eecdc87ac9c (patch)
treeb53c2e17d8ac93a157d8d0a22f1a2c19e3fc42ee /include
parent5cc0fa1e39c497c2ca02b019bbb6f51b95bad919 (diff)
[sanitizer] add a weak hook for memcmp interceptor, to be used primarily for fuzzing. More hooks will be added later. So far this is a Linux-only feature
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/sanitizer/common_interface_defs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sanitizer/common_interface_defs.h b/include/sanitizer/common_interface_defs.h
index ef645e527..47df81b68 100644
--- a/include/sanitizer/common_interface_defs.h
+++ b/include/sanitizer/common_interface_defs.h
@@ -111,6 +111,15 @@ extern "C" {
// Sets the callback to be called right before death on error.
// Passing 0 will unset the callback.
void __sanitizer_set_death_callback(void (*callback)(void));
+
+ // Interceptor hooks.
+ // Whenever a libc function interceptor is called it checks if the
+ // corresponding weak hook is defined, and it so -- calls it.
+ // The primary use case is data-flow-guided fuzzing, where the fuzzer needs
+ // to know what is being passed to libc functions, e.g. memcmp.
+ // FIXME: implement more hooks.
+ void __sanitizer_weak_hook_memcmp(void *called_pc, const void *s1,
+ const void *s2, size_t n);
#ifdef __cplusplus
} // extern "C"
#endif