lkml.org 
[lkml]   [2020]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf] bpf: cgroup: allow multi-attach program to replace itself
On Mon, Jun 8, 2020 at 9:22 AM Lorenz Bauer <lmb@cloudflare.com> 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.
>
> Replacing a program with itself might seem weird, but it has
> some uses: first, it allows resetting the associated cgroup storage.
> Second, it makes the API consistent with the non-ALLOW_MULTI usage,
> where it is possible to replace a program with itself. Third, it
> aligns BPF_PROG_ATTACH with bpf_link, where replacing itself is
> also supported.
>
> Sice this code has been refactored a few times this change will
> only apply to v5.7 and later. Adjustments could be made to
> commit 1020c1f24a94 ("bpf: Simplify __cgroup_bpf_attach") and
> commit d7bf2c10af05 ("bpf: allocate cgroup storage entries on attaching bpf programs")
> as well as commit 324bda9e6c5a ("bpf: multi program support for cgroup+bpf")
>
> Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
> Fixes: af6eea57437a ("bpf: Implement bpf_link-based cgroup BPF program attachment")

Applied. Thanks

\
 
 \ /
  Last update: 2020-06-09 20:26    [W:0.105 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site