[PATCH] D92440: [dfsan] Support passing non-i16 shadow values in TLS mode

stephan.yichao.zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 17:24:30 PST 2020


stephan.yichao.zhao created this revision.
stephan.yichao.zhao added reviewers: morehouse, pcc.
Herald added subscribers: llvm-commits, Sanitizers, hiraditya.
Herald added projects: Sanitizers, LLVM.
stephan.yichao.zhao requested review of this revision.

  This is a child diff of D92261.
  
  It extended TLS arg/ret to work with aggregate types.
  
  For a function
    t foo(t1 a1, t2 a2, ... tn an)
  Its arguments shadow are saved in TLS args like
    a1_s, a2_s, ..., an_s
  TLS ret simply includes r_s. By calculating the type size of each shadow
  value, we can get their offset.
  
  This is similar to what MSan does. See __msan_retval_tls and __msan_param_tls
  from llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp.
  
  Note that this change does not add test cases for overflowed TLS
  arg/ret because this is hard to test w/o supporting aggregate shdow
  types. We will be adding them after supporting that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92440

Files:
  compiler-rt/lib/dfsan/dfsan.cpp
  llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
  llvm/test/Instrumentation/DataFlowSanitizer/arith.ll
  llvm/test/Instrumentation/DataFlowSanitizer/call.ll
  llvm/test/Instrumentation/DataFlowSanitizer/callback.ll
  llvm/test/Instrumentation/DataFlowSanitizer/fast16labels.ll
  llvm/test/Instrumentation/DataFlowSanitizer/load.ll
  llvm/test/Instrumentation/DataFlowSanitizer/select.ll
  llvm/test/Instrumentation/DataFlowSanitizer/union-large.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92440.308822.patch
Type: text/x-patch
Size: 20147 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201202/96c17e22/attachment.bin>


More information about the llvm-commits mailing list