cgroup: Honor caller's cgroup NS when resolving path
authorMichal Koutný <mkoutny@suse.com>
Fri, 26 Aug 2022 16:52:35 +0000 (18:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:24 +0000 (12:35 +0200)
commit507128a0e32dbd80f5d277f4f1730e55ea504499
treee057ccf630e28d5d611af0ddad1c6f75abe6993d
parent8ffe511b7de72712e7210894e9e71d184a43d33c
cgroup: Honor caller's cgroup NS when resolving path

[ Upstream commit 74e4b956eb1cac0e4c10c240339b1bbfbc9a4c48 ]

cgroup_get_from_path() is not widely used function. Its callers presume
the path is resolved under cgroup namespace. (There is one caller
currently and resolving in init NS won't make harm (netfilter). However,
future users may be subject to different effects when resolving
globally.)
Since, there's currently no use for the global resolution, modify the
existing function to take cgroup NS into account.

Fixes: a79a908fd2b0 ("cgroup: introduce cgroup namespaces")
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/cgroup/cgroup.c