]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, cgroup: Return ENOLINK for auto-detached links on update
authorJakub Sitnicki <jakub@cloudflare.com>
Sun, 31 May 2020 08:28:39 +0000 (10:28 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 1 Jun 2020 22:21:03 +0000 (15:21 -0700)
commitbf1203d7d381fab3bed9a7110fc33d5eb8e84414
tree0efdb4ab26c8013322151d42e1eaf31968ce0ed4
parente7de3c0b0b65bc51330ad114c2f1fad97249d555
bpf, cgroup: Return ENOLINK for auto-detached links on update

Failure to update a bpf_link because it has been auto-detached by a dying
cgroup currently results in EINVAL error, even though the arguments passed
to bpf() syscall are not wrong.

bpf_links attaching to netns in this case will return ENOLINK, which
carries the message that the link is no longer attached to anything.

Change cgroup bpf_links to do the same to keep the uAPI errors consistent.

Fixes: e7b78a6a310b ("bpf: Implement bpf_prog replacement for an active bpf_cgroup_link")
Suggested-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200531082846.2117903-6-jakub@cloudflare.com
kernel/bpf/cgroup.c