[PATCH] D150460: [gcov] Add nosanitize metadata to memory access instructions inserted by emitProfileNotes()

Mingjie Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 20:21:14 PDT 2023


Enna1 marked an inline comment as done.
Enna1 added a comment.

> Though, I guess you wouldn't ship coverage enabled in production.

Sure.

> I guess I'm worried about __llvm_gcov_ctr becoming some kind of vector for attack.

__llvm_gcov_ctr global variable is not instrumented by asan, see https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp#L1184

> Hmm...that I'm less comfortable with approving.

It's ok, if so, I can abandon this patch :) 
Or maybe we can add an option gcov-nosanitize?



================
Comment at: llvm/test/Transforms/GCOVProfiling/nosanitize.ll:1
+; RUN: mkdir -p %t && cd %t
+; RUN: opt < %s -S -passes=insert-gcov-profiling | FileCheck %s
----------------
nickdesaulniers wrote:
> Is this run line necessary?
Yes, it is for don't writing a.gcno in CWD. See other GCOVProfiling testcase (e.g. atomic-counter.ll, kcfi.ll)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150460



More information about the llvm-commits mailing list