-
Notifications
You must be signed in to change notification settings - Fork 271
Description
Describe the feature you'd like supported
ebpf-go has logic around handling maps which are pinned by name which is used to ensure persistence across application restarts. It works something like this:
- User sets
LIBBPF_PIN_BY_NAMEin C - User loads the ELF while specifying a prefix (there is no default to discourage clashes) in Go
- Then there is some logic which mirrors _ebpf_native_validate_map in the code base.
Implementing this scheme is not possible because for native images, the kernel part of the runtime handles pinning. If a map exists of wrong type we simply get EINVAL, which is too coarse an error.
Proposed solution
I'd like to be able to query pre-creation map metadata (essentially struct bpf_map_def) from a native image, after it has been loaded. I'd also like to be able to opt-out of handling of LIBBPF_PIN_BY_NAME in the runtime.
Additional context
I think that this could also allow reducing the amount of code we need in kernel space, since the runtime could do pinning in user space instead. Since pinning involves string manipulation / concatenation this could be valuable from a hardening perspective as well.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status