Thread (3 messages) flat view 3 messages, 3 authors, 2020-09-24

Re: [PATCH bpf] libbpf: fix XDP program load regression for old kernels

From: Alexei Starovoitov <hidden>
Date: 2020-09-24 17:34:48
Also in: bpf

On Thu, Sep 24, 2020 at 10:18 AM Andrii Nakryiko [off-list ref] wrote:
Fix regression in libbpf, introduced by XDP link change, which causes XDP
programs to fail to be loaded into kernel due to specified BPF_XDP
expected_attach_type. While kernel doesn't enforce expected_attach_type for
BPF_PROG_TYPE_XDP, some old kernels already support XDP program, but they
don't yet recognize expected_attach_type field in bpf_attr, so setting it to
non-zero value causes program load to fail.

Luckily, libbpf already has a mechanism to deal with such cases, so just make
expected_attach_type optional for XDP programs.

Reported-by: Nikita Shirokov <redacted>
Reported-by: Udip Pant <redacted>
Fixes: dc8698cac7aa ("libbpf: Add support for BPF XDP link")
Signed-off-by: Andrii Nakryiko <redacted>
Applied. Thanks

Looks like libbpf CI needs to add a few old kernels.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help