Skip to content

C++: Add an interface for models to block flow - #15528

Merged
MathiasVP merged 4 commits into
github:mainfrom
MathiasVP:flow-barrier-interface
Feb 7, 2024
Merged

C++: Add an interface for models to block flow#15528
MathiasVP merged 4 commits into
github:mainfrom
MathiasVP:flow-barrier-interface

Conversation

@MathiasVP

@MathiasVP MathiasVP commented Feb 6, 2024

Copy link
Copy Markdown
Contributor

This PR adds a new abstract class FlowOutBarrierFunction for blocking flow out of a function model. One of the obvious examples is std::swap where we on main has this FP:

void test() {
  char* s1 = tainted();
  char* s2 = nullptr;
  std::swap(s1, s2);
  sink(s1); // should not be tainted
}

This PR adds an interface for specifying that such functions shouldn't have flow out of a given FunctionInput. Operationally, this amounts to blocking use-use flow once the data reaches the function's input.

In this PR I've just implemented the class on std::swap. Once the change is in we can provide extents for a bunch of other classes that we currently model.

@MathiasVP
MathiasVP requested a review from a team as a code owner February 6, 2024 16:20
@github-actions github-actions Bot added the C++ label Feb 6, 2024

@rdmarsh2 rdmarsh2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code and tests LGTM. There's a fair bit of noise on the DCA run, it might be worth rechecking some of the projects with bigger slowdowns.

@MathiasVP

MathiasVP commented Feb 7, 2024

Copy link
Copy Markdown
Contributor Author

Code and tests LGTM. There's a fair bit of noise on the DCA run, it might be worth rechecking some of the projects with bigger slowdowns.

Thanks! I'm not sure what slowdowns you're referring to? The largest slowdown is abseil which has a 5% slowdown (49 seconds out of ~1000 seconds). I don't think this is worth digging into.

Stage timing is also showing a less-than-5% slowdown which I think we can attribute to noise

@MathiasVP
MathiasVP merged commit c5dc883 into github:main Feb 7, 2024
MathiasVP added a commit to MathiasVP/ql that referenced this pull request Feb 9, 2024
…nterface"

This reverts commit c5dc883, reversing
changes made to 7814861.
MathiasVP added a commit to MathiasVP/ql that referenced this pull request Feb 13, 2024
…nterface"

This reverts commit c5dc883, reversing
changes made to 7814861.
MathiasVP added a commit to MathiasVP/ql that referenced this pull request Feb 13, 2024
…nterface"

This reverts commit c5dc883, reversing
changes made to 7814861.
@MathiasVP MathiasVP mentioned this pull request Feb 13, 2024
MathiasVP added a commit that referenced this pull request Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants