summaryrefslogtreecommitdiff
path: root/lib/dfsan
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2019-06-13 20:11:06 +0000
committerKostya Serebryany <kcc@google.com>2019-06-13 20:11:06 +0000
commit6ac86bdc1602faac865d13039fd000e9e5ef1f58 (patch)
tree6638b4f732bbad93070eb5a5dc06b5d2758068da /lib/dfsan
parent5387380520179d5fb5fd2575e8aed5be8cf52985 (diff)
downloadcompiler-rt-6ac86bdc1602faac865d13039fd000e9e5ef1f58.tar.gz
[dfsan] Introduce dfsan_flush().
Summary: dfsan_flush() allows to restart tain tracking from scratch in the same process. The primary purpose right now is to allow more efficient data flow tracing for DFT fuzzing: https://github.com/google/oss-fuzz/issues/1632 Reviewers: pcc Reviewed By: pcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63037 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@363321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/dfsan')
-rw-r--r--lib/dfsan/dfsan.cc6
-rw-r--r--lib/dfsan/done_abilist.txt2
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/dfsan/dfsan.cc b/lib/dfsan/dfsan.cc
index b206908a5..237423192 100644
--- a/lib/dfsan/dfsan.cc
+++ b/lib/dfsan/dfsan.cc
@@ -421,6 +421,12 @@ static void dfsan_fini() {
}
}
+extern "C" void dfsan_flush() {
+ UnmapOrDie((void*)ShadowAddr(), UnusedAddr() - ShadowAddr());
+ if (!MmapFixedNoReserve(ShadowAddr(), UnusedAddr() - ShadowAddr()))
+ Die();
+}
+
static void dfsan_init(int argc, char **argv, char **envp) {
InitializeFlags();
diff --git a/lib/dfsan/done_abilist.txt b/lib/dfsan/done_abilist.txt
index 9765626ad..f8c88dd32 100644
--- a/lib/dfsan/done_abilist.txt
+++ b/lib/dfsan/done_abilist.txt
@@ -26,6 +26,8 @@ fun:dfsan_has_label_with_desc=uninstrumented
fun:dfsan_has_label_with_desc=discard
fun:dfsan_set_write_callback=uninstrumented
fun:dfsan_set_write_callback=custom
+fun:dfsan_flush=uninstrumented
+fun:dfsan_flush=discard
###############################################################################
# glibc