-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Python: Port use-use implementation from Java #4235
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c661f43
Python: Port use-use implementation from Java
yoff ce7f82d
Python: Add def-use jump-steps
yoff 9e59d79
Python: Repair flow from pre-update nodes
yoff b156782
Python: Repair flow out of post-update nodes
yoff 7b10a3a
Python: fix comment and source uses
yoff deb1a4c
Merge branch 'main' of github.com:github/codeql into SharedDataflow_U…
yoff 2eb8ea8
Python: update test expectations
yoff 3a19b1e
Apply suggestions from code review
yoff 92e7a56
Python: Address review comments
yoff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
2 changes: 1 addition & 1 deletion
2
python/ql/test/experimental/dataflow/tainttracking/customSanitizer/TestTaint.expected
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In these three cases, C# takes any of the last reads of the input variable as
nodeFrom, and only if there are no reads do we take the SSA node. I believe this will currently not workbecause you will jump directly from both definitions of
xto the call tosink.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even worse, something like this will (I believe) also not work:
because there is not step from the
xinx.Foo = taintto the phi node forxafter the if-then-else.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yoff have you added the testcases from above somewhere, and checked how we handle them after use-use flow? 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think the latter case will work, as long as the store step in
x.Foo = tainttargets the refined SSA node forx. But if it instead targets the post-update node forx(as for Java and C#), the change is needed (and it will be needed for the first case anyway).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet (but very soon), the need is tracked here. I think we probably need to remove some essa-flow and let use-use do the work.