Re: [PATCH bpf] bpf: cgroup: allow multi-attach program to replace itself

2020-06-09 Thread Alexei Starovoitov
On Mon, Jun 8, 2020 at 9:22 AM Lorenz Bauer wrote: > > When using BPF_PROG_ATTACH to attach a program to a cgroup in > BPF_F_ALLOW_MULTI mode, it is not possible to replace a program > with itself. This is because the check for duplicate programs > doesn't take the replacement program into account

[PATCH bpf] bpf: cgroup: allow multi-attach program to replace itself

2020-06-08 Thread Lorenz Bauer
When using BPF_PROG_ATTACH to attach a program to a cgroup in BPF_F_ALLOW_MULTI mode, it is not possible to replace a program with itself. This is because the check for duplicate programs doesn't take the replacement program into account. Replacing a program with itself might seem weird, but it ha