diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-07-31 20:28:26 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-08-02 05:38:28 +0200 |
commit | 73b11c2ab072d5b0599d1e12cc126f55ee306daf (patch) | |
tree | 0b005d7d70f073d7d908e0d2a1fb263405f3971b /tools/lib/bpf/bpf.h | |
parent | bpf, selftests: Use single cgroup helpers for both test_sockmap/progs (diff) | |
download | linux-73b11c2ab072d5b0599d1e12cc126f55ee306daf.tar.xz linux-73b11c2ab072d5b0599d1e12cc126f55ee306daf.zip |
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
Diffstat (limited to 'tools/lib/bpf/bpf.h')
0 files changed, 0 insertions, 0 deletions