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

BPF bytecode is not disassembled completely #2211

Closed
vobst opened this issue Nov 30, 2023 · 2 comments
Closed

BPF bytecode is not disassembled completely #2211

vobst opened this issue Nov 30, 2023 · 2 comments

Comments

@vobst
Copy link

vobst commented Nov 30, 2023

Context:
I use capstone to disassemble BPF bytecode extracted from kernel crash dumps.

Problem:
For some BPF programs, Capstone does not disassemble the complete bytecode. objdump and bpftool are able to display the correct disassembly for the same files.

Reproducer:
I attached two BPF programs and a script to disassemble them. The netns one should have about 120 instructions, the other about 40. Compare for example to objdump -m bpf -b binary -D prog_structops.bin.
poc.zip

Tested capstone version:

  • current master, i.e., pip3 "https://github.com/aquynh/capstone/archive/next.zip#egg=capstone&subdirectory=bindings/python"
  • 5.0.1
@Rot127
Copy link
Collaborator

Rot127 commented Nov 30, 2023

Just like many other archs, BPF is very much outdated.
We have a new update tool now which should make it easier. Though Capstone lacks maintainers and it would need someone to update BPF. Also see #2015

@vobst
Copy link
Author

vobst commented Dec 1, 2023

That's sad to hear. I don't think I currently have the resources to port the BPF arch to the new sync mechanism, sorry.

@vobst vobst closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2023
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

No branches or pull requests

2 participants