-
Notifications
You must be signed in to change notification settings - Fork 69
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
Support dumping seccomp on aarch64 #125
Conversation
Thanks for this contribution! It basically looks fine but the tests failed with unclear reasons (I would guess it's related to the ptrace change) Also please add tests to ensure the coverage reaches 100% ;) |
Thanks for looking at this! A couple of questions above, but regarding testing: I'm not a Rubyist by any means so I'm mostly just stumbling around trying things while working with this. To test locally I have been running Regarding adding tests: I tried this against a binary from DEF CON and this example I found online, tweaked slightly. For the latter I changed out the architecture when installing the filter and changed it block |
Yes I see. So for now you can simply add tests against the functions don't need an ARM binary, such as |
1c3ae83
to
ecb29a7
Compare
Turns out Yama was being too mindful and rejecting trace requests :/ Then I fixed some of the offsets for i386, since Linux apparently uses a 4 byte pointer size with I've added comments and checks for the things you've mentioned in ptrace.c, and there's a test for disasm and emu based off of the bdooos challenge from DEF CON–the binary for which I've committed as well. Let me know if there's anything else you'd like me to add. |
As part of this change, fix some non-general code for detecting architectures and switch to move off of PTRACE_GETUSER, which is not functional on aarch64.
Done, done, and done :) |
Merged, thanks for the contribution! |
This adds support for dumping seccomp BPF on aarch64–doing it by hand for DEF CON is fine once, but I'd rather not have to do it again :) The setup I used to test this is extraordinarily janky (CTF challenge-provided binary/kernel running in QEMU using initramfs+a homegrown rootfs that has literally every single dependency in it available offline, since I can't figure out how to set up networking). Seems to work on some simple binaries I tested it against, but I couldn't figure out how to get the actual test suite running so if you have guidance there it would be much appreciated.