Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cgroup attach flags being assigned to effective progs #3523

Closed
wants to merge 3 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: Fix cgroup attach flags being assigned to effective progs
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=669445

@kernel-patches-bot
Copy link
Author

Master branch: b979f00
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=669445
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 92ec1cc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=669445
version: 1

Kernel Patches Daemon and others added 3 commits August 23, 2022 14:04
Attach flags is only valid for attached progs of this layer cgroup,
but not for effective progs. We know that the attached progs is at
the beginning of the effective progs array, so we can just populate
the elements in front of the prog_attach_flags array.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
When root-cgroup attach multi progs and sub-cgroup attach a
override prog, bpftool will display incorrectly for the attach
flags of the sub-cgroup’s effective progs:

$ bpftool c t /sys/fs/cgroup effective
CgroupPath
ID       AttachType      AttachFlags     Name
/sys/fs/cgroup
6        sysctl          multi           sysctl_tcp_mem
13       sysctl          multi           sysctl_tcp_mem
/sys/fs/cgroup/cg1
    20       sysctl          override        sysctl_tcp_mem
    6        sysctl          override        sysctl_tcp_mem
    13       sysctl          override        sysctl_tcp_mem

Attach flags is only valid for attached progs of this layer
cgroup, but not for effective progs. Since prog_attach_flags
array is already bypass the effective progs, so we can just
use it.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
@kernel-patches-bot
Copy link
Author

Master branch: 92ec1cc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=669445
version: 1

@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=669445 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant