Fix infinite loops in copy propagation optimizer#876
Merged
s3rvac merged 1 commit intoavast:masterfrom Oct 31, 2020
jacob-baines:opt_inf_loop
Merged
Fix infinite loops in copy propagation optimizer#876s3rvac merged 1 commit intoavast:masterfrom jacob-baines:opt_inf_loop
s3rvac merged 1 commit intoavast:masterfrom
jacob-baines:opt_inf_loop
Conversation
Member
|
Hi, thanks for the contribution 👍 Let me run TeamCity tests to see if everything passes after the fix. |
s3rvac
approved these changes
Oct 31, 2020
Member
s3rvac
left a comment
There was a problem hiding this comment.
All tests pass and the fix LGTM, so I am going to merge the PR. Thanks again!
s3rvac
added a commit
that referenced
this pull request
Oct 31, 2020
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.
I came across a couple of infinite loops in copy_propagation_optimizer.cpp using the attach file.
sslvpnd.zip
The sslvpnd binary should have a
sha256sumof 856b68307d53d0f20f5c4a91aefc3146382e4e4210c758655d53135669642557 or you can find the binary embedded in this firmware.The infinite loop(s) can be reproduced by fetching retdec master from Github, compiling, and executing retdec-decompiler:
After a couple of minutes, retdec drops into an infinite. The issue appears to be similar to 55d46b5f3a4a5ec038ab33331926a195c7f33250, in that copy_progragation_optimizer is walking backwards through statements that loop. I followed a similar solution as introduced in the previous commit, basically exiting the loop if we see the same statement twice. With this change, sslvpnd is successfully processed after approximately 5 minutes.
I looked at the style guide and I'm not 100% my for loop line break is okay or not. Happy to fix if needed.