-
Notifications
You must be signed in to change notification settings - Fork 118
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
Implement tracking of nested parameters #432
Merged
Merged
Conversation
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
…ad during FnSig analysis
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.
Enable the function signature analysis and the pointer inference analysis to track nested parameters. Also solve long-standing state explosion problems.
The function signature analysis and the pointer inference analysis can now track nested parameters. As a consequence, subsequent analyses can also track these memory objects, thus enabling the detection of more bugs. However, the nesting depth of such nested parameters is limited to avoid state explosion.
Furthermore, we implement a new tracking strategy for memory objects created in a function and then returned to a caller. The previous tracking strategy was tracking all such objects via their point of origin. This was leading to state explosion in some cases where many points of origin could lead to the same return value. Since tracking of nested parameters was bound to make these problems worse, we switched to a different strategy: Now, returned objects are merged to unique objects identified by the position (return register or position inside mutable parameter object) where they are returned. Thus, multiple points of origin for the same returned object are merged accordingly. Objects that do not have a unique return location (e.g. they may be returned in different return registers at the same time) are not tracked by the caller. This change will impact the soundness and precision of the analysis, in some cases in a positive way and sometimes in a negative way. But the most important aspect for us right now is that it solves the state explosion problems that the cwe_checker was experiencing.
It should be noted that this PR leads to a reduction in the detection capabilities of the CWE-119 check, since it is now only partially interprocedural. The implementation suffered from the same state explosion problem as the pointer inference. Refactoring the check to restore full interprocedurality is left for a future PR.