linux-stable/kernel/cgroup
Chen Ridong 8c222df370 cgroup/bpf: only cgroup v2 can be attached by bpf programs
[ Upstream commit 2190df6c91 ]

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 04f8ef5643
("cgroup: Fix memory leak caused by missing cgroup_bpf_offline"), which
has been reverted.

Fixes: 2b0d3d3e4f ("percpu_ref: reduce memory footprint of percpu_ref in fast path")
Fixes: 4bfc0bb2c6 ("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>
2024-12-14 19:53:21 +01:00
..
cgroup-internal.h cgroup: Make operations on the cgroup root_list RCU safe 2024-08-19 06:00:06 +02:00
cgroup-v1.c kernfs: Convert kernfs_path_from_node_locked() from strlcpy() to strscpy() 2024-08-03 08:48:54 +02:00
cgroup.c cgroup/bpf: only cgroup v2 can be attached by bpf programs 2024-12-14 19:53:21 +01:00
cpuset.c cgroup/cpuset: Prevent UAF in proc_cpuset_show() 2024-08-03 08:48:54 +02:00
debug.c kernel: cgroup: fix misuse of %x 2019-05-06 08:47:48 -07:00
freezer.c cgroup: cleanup comments 2022-03-13 19:19:27 -10:00
legacy_freezer.c cgroup_freezer: cgroup_freezing: Check if not frozen 2023-12-13 18:39:19 +01:00
Makefile cgroup: Add misc cgroup controller 2021-04-04 13:34:46 -04:00
misc.c misc_cgroup: remove error log to avoid log flood 2021-09-20 07:35:38 -10:00
namespace.c cgroup:namespace: Remove unused cgroup_namespaces_init() 2023-09-13 09:42:56 +02:00
pids.c cgroup: add pids.peak interface for pids controller 2022-09-04 09:26:51 -10:00
rdma.c cgroup: fix spelling mistakes 2021-05-24 12:45:26 -04:00
rstat.c cgroup: fix display of forceidle time at root 2023-04-20 12:35:13 +02:00