Skip to content
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

Fix infinite loops in copy propagation optimizer #876

Merged
merged 1 commit into from
Oct 31, 2020
Merged

Fix infinite loops in copy propagation optimizer #876

merged 1 commit into from
Oct 31, 2020

Conversation

jacob-baines
Copy link

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 sha256sum of 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:

albinolobster@ubuntu:~/retdec/build$ retdec-decompiler ~/sslvpnd

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.

@s3rvac
Copy link
Member

s3rvac commented Oct 31, 2020

Hi, thanks for the contribution 👍 Let me run TeamCity tests to see if everything passes after the fix.

Copy link
Member

@s3rvac s3rvac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests pass and the fix LGTM, so I am going to merge the PR. Thanks again!

@s3rvac s3rvac merged commit 9516741 into avast:master Oct 31, 2020
s3rvac added a commit that referenced this pull request Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants