-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Handle class intervals during in `propagate()`. Gist of it is: * At call-site: * Look-up the receiver's interval based on its register type. * Determine if the receiver is a `this.*` call (preserves type context = true) * When calling `propagate`: * Pass on receiver interval * Pass on caller's class interval (i.e. if caller is `C::m()`, use `interval(C)`). Use max interval for static methods. If callee is a `this.*` call, this would be the same as the receiver's class interval. When propagating, if the next hop (the propagated frame) is a `this.*` call, intersect the next hop's interval with the receiver's interval and use the intersection as the propagated interval. The frame is dropped if the intersection is empty as it means that the receiver's type is unrelated to the next hop's `this.*` type, i.e. the next hop is not reachable from here. If preserves_type_context = false, it is not a `this.*` call. We do not have any more information about how reachable the next hop, so taint should be propagated as before. NOTE: Because we do not yet call `propagate()` on propagations, class interval intersection only happens on source/sink frames at the moment. This change would address invalid traces of the following form: ``` void Base::toSink(Object argument) { // This resolves to Derived*.derivedToSink(), e.g. // interval(DerivedA) -> DerivedA.derivedToSink() // interval(DerivedB) -> DerivedB.derivedToSink() // ... this.derivedToSink(argument); } void toSink(DerivedA derivedA, Object argument) { // If DerivedA does not override toSink(), this resolves to Base.toSink() // Without class intervals, the analysis this leads to all Derived*.derivedToSink() sinks. // With class intervals, only classes in the hierarchy of DerivedA's // will have an interval that intersects with the receiver's type (DerivedA). // All other sinks are invalid and will be dropped. derivedA.toSink(argument); } ``` ___ Reviewed By: arthaud Differential Revision: D47763382 fbshipit-source-id: f0827384580dadd831f756121fbf61cc83ac3208
- Loading branch information
1 parent
651e489
commit b554e07
Showing
27 changed files
with
674 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.