linux/kernel/bpf
Jakub Sitnicki 0c047ecbb7 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: 0c991ebc8c ("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
2020-06-01 15:21:03 -07:00
..
arraymap.c
bpf_iter.c bpf: Enable bpf_iter targets registering ctx argument types 2020-05-13 12:30:50 -07:00
bpf_lru_list.c
bpf_lru_list.h
bpf_lsm.c bpf: Use tracing helpers for lsm programs 2020-06-01 15:08:04 -07:00
bpf_struct_ops.c
bpf_struct_ops_types.h
btf.c bpf: Enable bpf_iter targets registering ctx argument types 2020-05-13 12:30:50 -07:00
cgroup.c bpf, cgroup: Return ENOLINK for auto-detached links on update 2020-06-01 15:21:03 -07:00
core.c bpf: Fix spelling in comment explaining ARG1 in ___bpf_prog_run 2020-06-01 14:38:20 -07:00
cpumap.c xdp: Rename convert_to_xdp_frame in xdp_convert_buff_to_frame 2020-06-01 15:02:53 -07:00
devmap.c xdp: Rename convert_to_xdp_frame in xdp_convert_buff_to_frame 2020-06-01 15:02:53 -07:00
disasm.c
disasm.h
dispatcher.c
hashtab.c
helpers.c bpf: Implement BPF ring buffer and verifier support for it 2020-06-01 14:38:22 -07:00
inode.c bpf: Create file bpf iterator 2020-05-09 17:05:26 -07:00
local_storage.c
lpm_trie.c
Makefile flow_dissector: Move out netns_bpf prog callbacks 2020-06-01 15:21:02 -07:00
map_in_map.c
map_in_map.h
map_iter.c
net_namespace.c bpf: Add link-based BPF program attachment to network namespace 2020-06-01 15:21:03 -07:00
offload.c
percpu_freelist.c
percpu_freelist.h
queue_stack_maps.c
reuseport_array.c
ringbuf.c bpf: Implement BPF ring buffer and verifier support for it 2020-06-01 14:38:22 -07:00
stackmap.c
syscall.c bpf: Add link-based BPF program attachment to network namespace 2020-06-01 15:21:03 -07:00
sysfs_btf.c
task_iter.c
tnum.c
trampoline.c
verifier.c bpf: Implement BPF ring buffer and verifier support for it 2020-06-01 14:38:22 -07:00