On 10/4/22 4:11 PM, Daniel Borkmann wrote:
static int __xtc_prog_detach(struct net_device *dev, bool ingress, u32 limit, - u32 prio) + u32 id, u32 prio) { struct bpf_prog_array_item *item, *tmp; struct bpf_prog *oprog, *fprog = NULL; @@ -126,8 +133,11 @@ static int __xtc_prog_detach(struct net_device *dev, bool ingress, u32 limit, if (item->bpf_priority != prio) { tmp->prog = oprog; tmp->bpf_priority = item->bpf_priority; + tmp->bpf_id = item->bpf_id; j++; } else { + if (item->bpf_id != id) + return -EBUSY;
A nit. Should this be -ENOENT? I think the cgroup detach is also returning -ENOENT for the not found case.
btw, this case should only happen from the BPF_PROG_DETACH but not the BPF_LINK_DETACH?