aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/FileCheck/FileCheck.cpp
diff options
context:
space:
mode:
authorJianzhou Zhao <jianzhouzh@google.com>2021-01-28 22:36:47 +0000
committerJianzhou Zhao <jianzhouzh@google.com>2021-02-02 22:07:17 +0000
commite1a4322f8136788228d915a7384c5679b39dfeed (patch)
tree3aac3dd37dda8a1d671e804d23cc45ab292ec080 /llvm/utils/FileCheck/FileCheck.cpp
parentd8e90716dfd186943359c7ade83cc2d1d247f140 (diff)
downloadllvm-e1a4322f8136788228d915a7384c5679b39dfeed.zip
llvm-e1a4322f8136788228d915a7384c5679b39dfeed.tar.gz
llvm-e1a4322f8136788228d915a7384c5679b39dfeed.tar.bz2
[dfsan] Clean TLS after sigaction callbacks
DFSan uses TLS to pass metadata of arguments and return values. When an instrumented function accesses the TLS, if a signal callback happens, and the callback calls other instrumented functions with updating the same TLS, the TLS is in an inconsistent state after the callback ends. This may cause either under-tainting or over-tainting. This fix follows MSan's workaround. https://github.com/llvm/llvm-project/commit/cb22c67a21e4b5e1ade65141117a70be318be072 It simply resets TLS at restore. This prevents from over-tainting. Although under-tainting may still happen, a taint flow can be found eventually if we run a DFSan-instrumented program multiple times. The alternative option is saving the entire TLS. However the TLS storage takes 2k bytes, and signal calls could be nested. So it does not seem worth. This diff fixes sigaction. A following diff will be fixing signal. Reviewed-by: morehouse Differential Revision: https://reviews.llvm.org/D95642
Diffstat (limited to 'llvm/utils/FileCheck/FileCheck.cpp')
0 files changed, 0 insertions, 0 deletions