linux/kernel/bpf
Andrii Nakryiko 73b11c2ab0 bpf: Add support for forced LINK_DETACH command
Add LINK_DETACH command to force-detach bpf_link without destroying it. It has
the same behavior as auto-detaching of bpf_link due to cgroup dying for
bpf_cgroup_link or net_device being destroyed for bpf_xdp_link. In such case,
bpf_link is still a valid kernel object, but is defuncts and doesn't hold BPF
program attached to corresponding BPF hook. This functionality allows users
with enough access rights to manually force-detach attached bpf_link without
killing respective owner process.

This patch implements LINK_DETACH for cgroup, xdp, and netns links, mostly
re-using existing link release handling code.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200731182830.286260-2-andriin@fb.com
2020-08-01 20:38:28 -07:00
..
Makefile bpf: Add bpf_prog iterator 2020-07-25 20:16:32 -07:00
arraymap.c bpf: Implement bpf iterator for array maps 2020-07-25 20:16:33 -07:00
bpf_iter.c bpf: Implement bpf iterator for map elements 2020-07-25 20:16:32 -07:00
bpf_lru_list.c
bpf_lru_list.h
bpf_lsm.c
bpf_struct_ops.c
bpf_struct_ops_types.h
btf.c bpf: Support readonly/readwrite buffers in verifier 2020-07-25 20:16:32 -07:00
cgroup.c bpf: Add support for forced LINK_DETACH command 2020-08-01 20:38:28 -07:00
core.c bpf: Make cgroup storages shared between programs on the same cgroup 2020-07-25 20:16:35 -07:00
cpumap.c bpf: cpumap: Fix possible rcpu kthread hung 2020-07-21 09:15:28 -07:00
devmap.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2020-07-04 17:48:34 -07:00
disasm.c
disasm.h
dispatcher.c
hashtab.c bpf: Implement bpf iterator for hash maps 2020-07-25 20:16:33 -07:00
helpers.c
inode.c
local_storage.c bpf/local_storage: Fix build without CONFIG_CGROUP 2020-07-25 20:16:36 -07:00
lpm_trie.c bpf: Remove redundant synchronize_rcu. 2020-07-01 08:07:13 -07:00
map_in_map.c
map_in_map.h
map_iter.c bpf: Implement bpf iterator for array maps 2020-07-25 20:16:33 -07:00
net_namespace.c bpf: Add support for forced LINK_DETACH command 2020-08-01 20:38:28 -07:00
offload.c
percpu_freelist.c
percpu_freelist.h
prog_iter.c bpf: Refactor bpf_iter_reg to have separate seq_info member 2020-07-25 20:16:32 -07:00
queue_stack_maps.c bpf: Remove redundant synchronize_rcu. 2020-07-01 08:07:13 -07:00
reuseport_array.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-07-11 00:46:00 -07:00
ringbuf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-07-11 00:46:00 -07:00
stackmap.c bpf: Fix build on architectures with special bpf_user_pt_regs_t 2020-07-25 20:16:36 -07:00
syscall.c bpf: Add support for forced LINK_DETACH command 2020-08-01 20:38:28 -07:00
sysfs_btf.c
task_iter.c bpf: Refactor to provide aux info to bpf_iter_init_seq_priv_t 2020-07-25 20:16:32 -07:00
tnum.c
trampoline.c
verifier.c bpf: Add missing newline characters in verifier error messages 2020-07-31 00:43:49 +02:00