Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 7, 2024

Conversation

MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Feb 6, 2024

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
Copy link
Contributor

@rdmarsh2 rdmarsh2 left a comment

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
Copy link
Contributor Author

MathiasVP commented Feb 7, 2024

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