[all-commits] [llvm/llvm-project] fc1d39: [dfsan] Add a flag about whether to propagate offs...

Z via All-commits all-commits at lists.llvm.org
Thu May 27 17:08:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc1d39849e8d57ec8cb2ce0e1581faa88ae72fbe
      https://github.com/llvm/llvm-project/commit/fc1d39849e8d57ec8cb2ce0e1581faa88ae72fbe
  Author: Jianzhou Zhao <jianzhouzh at google.com>
  Date:   2021-05-28 (Fri, 28 May 2021)

  Changed paths:
    A compiler-rt/test/dfsan/gep.c
    M llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
    A llvm/test/Instrumentation/DataFlowSanitizer/dont_combine_offset_labels_on_gep.ll

  Log Message:
  -----------
  [dfsan] Add a flag about whether to propagate offset labels at gep

DFSan has flags to control flows between pointers and objects referred
by pointers. For example,

a = *p;
L(a) = L(*p)        when -dfsan-combine-pointer-labels-on-load = false
L(a) = L(*p) + L(p) when -dfsan-combine-pointer-labels-on-load = true

*p = b;
L(*p) = L(b)        when -dfsan-combine-pointer-labels-on-store = false
L(*p) = L(b) + L(p) when -dfsan-combine-pointer-labels-on-store = true
The question is what to do with p += c.

In practice we found many confusing flows if we propagate labels from c
to p. So a new flag works like this

p += c;
L(p) = L(p)        when -dfsan-propagate-via-pointer-arithmetic = false
L(p) = L(p) + L(c) when -dfsan-propagate-via-pointer-arithmetic = true

Reviewed-by: gbalats

Differential Revision: https://reviews.llvm.org/D103176




More information about the All-commits mailing list