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
JS: Replace barrier edges with barrier nodes #13719
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
The test had a bug on the line `src = src` so the new code is "more equivalent than usual"
erik-krogh
approved these changes
Jul 13, 2023
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.
That was an easy commit-by-commit read, nice 👍
LGTM.
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.
In preparation for moving JS to the shared data flow library, this PR removes all uses of barrier edges, replacing them with barrier nodes.
Theoretically it is not always possible to replace arbitrary barrier edges with barrier nodes, but for our use cases it seems to be possible. The shared library does not support barrier edges, and given that they can in practice become barrier nodes, there isn't a very strong use case for adding them.
The PR also adds
isBarrierInandisBarrierOutto theDataFlow::Configurationclass, mimicking those from the shared library. These sometimes come in handy when replacing barrier edges.Clear-text logging was a bit problematic as it opts out of the default PropRead taint step
x -> x.propby adding such steps as barrier edges. Neither ends of such an edge could be mapped to a barrier node, because the predecessor can have other outgoing edges, and the successor can have other ingoing edges. The solution I went with was to block the predecessor, but exclude cases where it might have other outgoing edges (and in those cases, we retain flow through the defaultx -> x.propedge). It's not an elegant solution, though I'm not sure barrier edges were the best way to opt out of such taint steps in the first place. When and if we need a better solution, I'd rather work it out after transitioning to the shared data flow library.Evaluation looks good.
js/insecure-randomnesshave been removed/fixed. The new out-barrier more accurately handles what the barrier edge tried to do, which is to prevent flow out of sinks. The old barrier edge needed to restrictsuccto avoid a blow-up, but this restriction only included local flow steps.