Skip to content

compile eBPF against a runtime-generated vmlinux.h #1777

@rectified95

Description

@rectified95

Currently Retina compiles its eBPF programs during pod startup, however it links with a static vmlinux.h file that is checked in the repo.
This is wrong because it risks reading garbage data at incorrect kernel structure offsets.

One correct way is to generate the header at compile time to match the runtime environment's kernel:
bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions