[PATCH] D109233: [hwasan] Respect returns attribute when tracking values.

Florian Mayer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 02:04:26 PDT 2021


fmayer marked an inline comment as done.
fmayer added inline comments.


================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:397
         // alloca.
         US.addRange(I, UnknownRange);
         break;
----------------
vitalybuka wrote:
> Isn't this in the call will make it unsafe anyway?
This is for being able to prove accesses safe, not the whole alloca.


================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:416
         const auto &CB = cast<CallBase>(*I);
+        if (CB.getReturnedArgOperand() == V) {
+          if (Visited.insert(I).second)
----------------
vitalybuka wrote:
> does SCEV can look through such calls?
Yes, it does.


================
Comment at: llvm/test/Instrumentation/HWAddressSanitizer/stack-safety-analysis.ll:159
+; Check whether we see through the returns attribute of functions.
+define i32 @test_retptr(i32* %a) sanitize_hwaddress {
+entry:
----------------
vitalybuka wrote:
> Having that retptr has no body here, SAFETY should make it "call to retptr" unsafe anyway
Yes, but it can tell that the `store` is safe.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109233



More information about the llvm-commits mailing list