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 how original_size and addr are treated for Fake AIL Blocks #4572

Open
mahaloz opened this issue Apr 11, 2024 · 0 comments
Open

Fix how original_size and addr are treated for Fake AIL Blocks #4572

mahaloz opened this issue Apr 11, 2024 · 0 comments
Labels
bug Something is broken

Comments

@mahaloz
Copy link
Member

mahaloz commented Apr 11, 2024

Description

After debugging some code that flowed through to_ail_supergraph, it became clear that this line is causing problems:

if (type_ == "fake_return") or (src.addr + src.original_size == dst.addr):

For completely normal AIL nodes (ones converted from Vex and untouched), this is a sane check. However, in the case of AIL nodes that have been created, this check fails. Any of the DUPLICATING optimizations, can create new nodes:

At first, I thought you course just set original_size=None, and then do a special check in to_ail_supergraph, but this causes crashes elsewhere.

In summary, angr is not positioned to handle AIL nodes that have either fake addresses or fake sizes. We need to fix this eventually.

The Fix

  1. Introduce a new property to nodes is_fake, meaning the node was created
  2. Go through all places that use .addr or .original_size and update them to no longer trust these values

Steps to reproduce the bug

No response

Environment

No response

Additional context

No response

@mahaloz mahaloz added bug Something is broken needs-triage Issue has yet to be looked at by a maintainer and removed needs-triage Issue has yet to be looked at by a maintainer labels Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant