Commit f390525
cgroup/bpf: only cgroup v2 can be attached by bpf programs
[ Upstream commit 2190df6 ]
Only cgroup v2 can be attached by bpf programs, so this patch introduces
that cgroup_bpf_inherit and cgroup_bpf_offline can only be called in
cgroup v2, and this can fix the memleak mentioned by commit 04f8ef5
("cgroup: Fix memory leak caused by missing cgroup_bpf_offline"), which
has been reverted.
Fixes: 2b0d3d3 ("percpu_ref: reduce memory footprint of percpu_ref in fast path")
Fixes: 4bfc0bb ("bpf: decouple the lifetime of cgroup_bpf from cgroup itself")
Link: https://lore.kernel.org/cgroups/aka2hk5jsel5zomucpwlxsej6iwnfw4qu5jkrmjhyfhesjlfdw@46zxhg5bdnr7/
Signed-off-by: Chen Ridong <chenridong@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent dd6ade9 commit f390525
1 file changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2140 | 2140 | | |
2141 | 2141 | | |
2142 | 2142 | | |
2143 | | - | |
2144 | | - | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
2145 | 2147 | | |
2146 | 2148 | | |
2147 | 2149 | | |
| |||
5708 | 5710 | | |
5709 | 5711 | | |
5710 | 5712 | | |
5711 | | - | |
5712 | | - | |
5713 | | - | |
| 5713 | + | |
| 5714 | + | |
| 5715 | + | |
| 5716 | + | |
| 5717 | + | |
5714 | 5718 | | |
5715 | 5719 | | |
5716 | 5720 | | |
| |||
6024 | 6028 | | |
6025 | 6029 | | |
6026 | 6030 | | |
6027 | | - | |
| 6031 | + | |
| 6032 | + | |
6028 | 6033 | | |
6029 | 6034 | | |
6030 | 6035 | | |
| |||
0 commit comments