C++: Fix missing summaries in MaD generation#19383
Merged
MathiasVP merged 5 commits intogithub:mainfrom Apr 28, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes missing summaries in MaD generation by adding a default-valued predicate for extracting the ParameterPosition from certain ReturnNodes.
- Adds two new summary lines in the tests for toplevel_function to fetch argument taint information.
- Introduces a new struct (HasInt) and a copy_struct function with corresponding summary and contentbased-summary lines to ensure out parameter flow behavior is correctly modeled.
Files not reviewed (1)
- cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll: Language not supported
MathiasVP
commented
Apr 28, 2025
|
|
||
| //heuristic-summary=;;true;toplevel_function;(int *);;Argument[0];ReturnValue;taint;df-generated | ||
| //heuristic-summary=;;true;toplevel_function;(int *);;Argument[*0];ReturnValue;taint;df-generated | ||
| //heuristic-summary=;;true;toplevel_function;(int *);;Argument[0];Argument[*0];taint;df-generated |
Contributor
Author
There was a problem hiding this comment.
I don't totally understand where these taint steps are coming from, but it's not a fault of this PR. So I'd prefer leaving this as-is for now.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we merged #19295 we forgot to implement one of the default-valued predicates which is used to grab the
ParameterPositionfrom certainReturnNodes. This predicate is needed when generating flow models for out parameters in exampeles such as:we had tests that looked almost like the above, but they were making use of a slightly different dataflow mechanism for getting flow out of out parameters.
This PR adds the missing predicate. I've manually tested this PR on OpenSSL (for which we noticed the missing summaries originally).
Since the automation for testing summaries isn't quite ready yet, I think this manual testing suffices for now.
Commit-by-commit review recommended.