[PATCH] D104266: [DFSan] Handle landingpad inst explicitly as zero shadow.

stephan.yichao.zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 14 15:29:41 PDT 2021


stephan.yichao.zhao added a subscriber: eugenis.
stephan.yichao.zhao added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:2567
+  // Do nothing.
+  // See https://github.com/google/sanitizers/issues/504
+  DFSF.setShadow(&LPI, DFSF.DFS.getZeroShadow(&LPI));
----------------
This link does not explain this issue in details.
https://github.com/llvm/llvm-project/blame/dde9dcc24b23e0b8185cf7ce5072c0dc8ff086c9/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp shows that at the very beginning, MemorySanitizer has the comment here.

>From https://llvm.org/docs/ExceptionHandling.html#try-catch, we can see in practice the first element of the return value of a landing pad is an exception.
So this means it is possible to have data flows from an exception raise to here, but not 100% sure.
For MSan, it is only to ignore tracking this because at runtime all returned values can be assumed initialized. For DFSan, this may miss some flows.

@eugenis: Do you still happen to remember how  https://github.com/google/sanitizers/issues/504 affected MSan? I did not see how other sanitizers handle landing pads. Will DFSan be affected too?

Not sure if https://github.com/google/sanitizers/issues/504 implies any 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104266/new/

https://reviews.llvm.org/D104266



More information about the llvm-commits mailing list