Thread (19 messages) flat view 19 messages, 4 authors, 2020-08-10

Re: [PATCH bpf-next 1/5] bpf: add support for forced LINK_DETACH command

From: Song Liu <hidden>
Date: 2020-07-30 17:43:54
Also in: bpf

On Jul 29, 2020, at 4:05 PM, Andrii Nakryiko [off-list ref] wrote:

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 <redacted>
The code looks good to me. My only question is, do we need both 
bpf_link_ops->detach and bpf_link_ops->release? 

Thanks,
Song

[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help