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

Add check for Arm64 DWARF Expressions #2452

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add check for Arm64 DWARF Expressions #2452

wants to merge 3 commits into from

Conversation

Sylfrena
Copy link
Contributor

Test Plan

@Sylfrena Sylfrena requested a review from a team as a code owner January 26, 2024 11:14
@Sylfrena
Copy link
Contributor Author

Rebase on latest, updated testdata repo

DWARF Expressions are encoded with a `DW_CFA_def_cfa_expression` or
`DW_CFA_expression` (as per aarch64 DWARF ABI). However
grepping for either in `.eh_frame` debug information did not show any
results (including hardcoded PLT patter heuristics) unlike in x86.
(See #1058 for the x86 implementation).

Tested on system binaries and libc in multiple distros:
Debian, Fedora, Centos, Ubuntu

Workflow:
```
`docker run -it --network=host arm64v8/fedora bash`
`docker cp 0693985d3bba:/ ./fedrepo`

`sudo readelf -wf ./fedrepo/bin/* 2>/dev/null | grep
DW_CFA_cfa_def_expression`
`sudo readelf -wF ./centos-repo/bin/* 2>/dev/null | grep exp`

```
Return an error for now if we come across an expression in Arm64 binaries.

Signed-off-by: Sumera Priyadarsini <[email protected]>
@brancz
Copy link
Member

brancz commented Feb 7, 2024

What's left so that this is still WIP?

@Sylfrena
Copy link
Contributor Author

So sorry, didn't see your question earlier. I want to rebase this branch on latest testdata changes but haven't gotten to thoroughly check all the new uploaded binaries.

@Sylfrena Sylfrena changed the title [WIP] Add check for Arm64 DWARF Expressions Add check for Arm64 DWARF Expressions Mar 13, 2024
Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

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

lgtm but @kakkoyun and/or @gnurizen should have a look as well

Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

LGTM 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants