[PATCH] D118647: [hwasan] work around lifetime issue with setjmp.

Florian Mayer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 13:29:48 PST 2022


fmayer created this revision.
Herald added a subscriber: hiraditya.
fmayer requested review of this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.

setjmp can return twice, but PostDominatorTree is unaware of this. as
such, it overestimates postdominance, leaving some cases (see attached
compiler-rt) where memory does not get untagged on return. this causes
false positives later in the program execution.

this is a crude workaround to unblock use-after-scope for now, in the
longer term PostDominatorTree should bemade aware of returns_twice
function, as this may cause problems elsewhere.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118647

Files:
  compiler-rt/test/hwasan/TestCases/use-after-scope-setjmp.cpp
  llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
  llvm/test/Instrumentation/HWAddressSanitizer/use-after-scope-setjmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118647.404703.patch
Type: text/x-patch
Size: 5548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220131/5fead3b0/attachment.bin>


More information about the llvm-commits mailing list