Skip to content

Access first argument of syscall #1146

Description

@fhilgers

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions