Merge branch 'link_detach'
authorAlexei Starovoitov <ast@kernel.org>
Sun, 2 Aug 2020 03:38:29 +0000 (20:38 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 2 Aug 2020 03:38:59 +0000 (20:38 -0700)
commit5a6b1a206d1f399c9ea19173bd9a945a657f1fbf
tree585f89dd1a8b3bc02ccf7c0a431ee424b1fd81de
parent4939b2847d26c025e2e2118744226967f239a1ac
parente85f99aa7760e74bb5a7e8515948f99c264a275f
Merge branch 'link_detach'

Andrii Nakryiko says:

====================
This patch set adds new BPF link operation, LINK_DETACH, allowing processes
with BPF link FD to force-detach it from respective BPF hook, similarly how
BPF link is auto-detached when such BPF hook (e.g., cgroup, net_device, netns,
etc) is removed. This facility allows admin to forcefully undo BPF link
attachment, while process that created BPF link in the first place is left
intact.

Once force-detached, BPF link stays valid in the kernel as long as there is at
least one FD open against it. It goes into defunct state, just like
auto-detached BPF link.

bpftool also got `link detach` command to allow triggering this in
non-programmatic fashion.

v1->v2:
- improve error reporting in `bpftool link detach` (Song).
====================

Signed-off-by: Alexei Starovoitov <ast@kernel.org>