# [dfsan] Add a flag about whether to propagate offset labels at gepfc1d39849e8dActions

Authored by Jianzhou Zhao <jianzhouzh@google.com> on May 26 2021, 3:51 PM.
Tags
None
Subscribers
 Restricted Project

# Description

[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

# Details

Committed
 Jianzhou Zhao May 27 2021, 5:06 PM
Differential Revision
D103176: [dfsan] Add a flag about whether to propagate offset labels at gep
Parents
rG80e684b19423: Fix comment to reflect what the method is doing (NFC)
Branches
Unknown
Tags
Unknown

### Event Timeline

Jianzhou Zhao <jianzhouzh@google.com> committed rGfc1d39849e8d: [dfsan] Add a flag about whether to propagate offset labels at gep (authored by Jianzhou Zhao <jianzhouzh@google.com>).May 27 2021, 5:06 PM
Herald added a subscriber: Restricted Project. May 27 2021, 5:08 PM