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

angr can't handle 'endbr64', leading to incorrect function boundary #4571

Open
hwu71 opened this issue Apr 9, 2024 · 2 comments
Open

angr can't handle 'endbr64', leading to incorrect function boundary #4571

hwu71 opened this issue Apr 9, 2024 · 2 comments
Labels
bug Something is broken

Comments

@hwu71
Copy link
Collaborator

hwu71 commented Apr 9, 2024

Description

While examining the recent XZ backdoor using angr, it was observed that angr failed to correctly recognize the endbr64 instruction, which then led to incorrect function boundaries.

For reference, in IDA, the instruction at 0x144d0 is endbr64:
image

However, in angr, endbr64 was not recognized. Instead, angr incorrectly splits function 0x4144d0 into several functions: 0x4144d0, 0x4144d3, 0x4144d4.
image

In a previous discussion about endbr64 in 2018 (#1212), it was mentioned that the problem doesn't stem from angr directly, but rather from a lack of implementation in the underlying VEX IR.

Given this context, is the improper function boundary identification considered a bug? Moreover, how to fix this issue without altering the VEX IR?

Steps to reproduce the bug

binary: liblzma.so.5.5.99.zip
function address: 0x4144d0

Environment

Everything is in version 9.2.99.dev0 (current latest version)

Additional context

No response

@hwu71 hwu71 added bug Something is broken needs-triage Issue has yet to be looked at by a maintainer labels Apr 9, 2024
@ltfish
Copy link
Member

ltfish commented Apr 10, 2024

We don't need to alter VEX IR at all (we already added support to endbr32 and endbr64). The problem is that we are not treating endbr32/64 as function prologue sequences. I'll add them later.

@ltfish ltfish removed the needs-triage Issue has yet to be looked at by a maintainer label Apr 10, 2024
@hwu71
Copy link
Collaborator Author

hwu71 commented Apr 10, 2024

Thanks a lot for your explanation!

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

2 participants