diff options
author | Michal Koutný <mkoutny@suse.com> | 2022-08-26 18:52:36 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2022-08-26 10:57:10 -1000 |
commit | 4534dee941056a4ab9dca4a9e2edff28692800b2 (patch) | |
tree | 4b429a6e6fee0956eda3e3a8539ff68b432e3717 /mm/memcontrol.c | |
parent | 74e4b956eb1cac0e4c10c240339b1bbfbc9a4c48 (diff) |
cgroup: cgroup: Honor caller's cgroup NS when resolving cgroup id
Cgroup ids are resolved in the global scope. That may be needed sometime
(in future) but currently it violates virtual view provided through
cgroup namespaces.
There are currently following users of the resolution:
- fc_appid_store
- bpf_iter_attach_cgroup
- mem_cgroup_get_from_ino
None of the is a called on behalf of kernel but the resolution is made
with proper userspace context, hence the default to current->nsproxy
makes sens. (This doesn't rule out cgroup_get_from_id with cgroup NS
parameter in the future.)
Since cgroup ids are defined on v2 hierarchy only, we simply check
existence in the cgroup namespace by looking at ancestry on the default
hierarchy.
Fixes: 6b658c4863c1 ("scsi: cgroup: Add cgroup_get_from_id()")
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm/memcontrol.c')
0 files changed, 0 insertions, 0 deletions