Skip to content

failed to create BPF link for perf_event FD X: -EACCES #1259

@gmarler

Description

@gmarler

When attempting to attach a program to the syscalls/sys_exit_munmap tracepoint via libbpf-rs, I get this error and panic:

2025-10-22T19:22:49.127031Z  INFO lightswitch::profiler: munmap and process exit tracing BPF programs loaded
libbpf: prog 'tracer_exit_munmap': failed to create BPF link for perf_event FD 186: -EACCES
libbpf: prog 'tracer_exit_munmap': failed to attach to tracepoint 'syscalls/sys_exit_munmap': -EACCES
libbpf: prog 'tracer_exit_munmap': failed to auto-attach: -EACCES

And I'm running this as the root user on a physical machine.

Not seeing any issues in the libbpf debug log or via bpftool log messaging, so it doesn't look like a validation error either.

The BPF program in question resides here.

I'm not clear on if this is something I'm doing wrong, or an actual bug in libbpf or libbpf-rs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions