Skip to content

Libbpf eBPF macro BPF_CORE_READ_USER_STR_INTO

v0.4.0

The BPF_CORE_READ_USER_STR_INTO macro is a variant of the BPF_CORE_READ_USER_INTO macro, which is used to do a BPF CO-RE relocatable string read into user-provided storage.

Definition

#define BPF_CORE_READ_USER_INTO(dst, src, a, ...) ({                \
    ___core_read(bpf_core_read_user, bpf_core_read_user,            \
             dst, (src), a, ##__VA_ARGS__)              \
})

Usage

BPF_CORE_READ_USER_STR_INTO is very similar to BPF_CORE_READ_USER_INTO, but it uses the bpf_probe_read_user_str helper function instead of the bpf_probe_read_kernel_str helper function. This makes it better suites for reading NUL-terminated strings from userspace memory.

Please refer to the BPF_CORE_READ documentation for more details on usage of it and its variants like this macros.

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome