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

Access first argument of syscall #1146

Open
fhilgers opened this issue Jan 25, 2025 · 1 comment
Open

Access first argument of syscall #1146

fhilgers opened this issue Jan 25, 2025 · 1 comment

Comments

@fhilgers
Copy link

fhilgers commented Jan 25, 2025

The libbpf folks did the following here: libbpf/libbpf@9f6e3a7

I do not have a arm64 machine currently to test whether accessing the first syscall using aya works, but I stumbled over this while looking into their implementation and though this might be relevant here, as aya is just using arg[0] for pt_regs.

Also for syscalls on other platforms there are some differences, for example on x86_64 the 4th (starting from 1) argument is passed via r10 instaed of rcx like normal.

Maybe a note that PtRegs cannot be used for syscall arguments, tests or another struct for Syscall arguments might be useful. Let me know what you prefer.

Edit:

Relevant code here:

@tamird
Copy link
Member

tamird commented Jan 29, 2025

@fhilgers as of #1148 our integration tests are running on ARM. Would you like to work on adding a test that exercises this?

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