selftests: cgroup: Test open-time cgroup namespace usage for migration checks
authorTejun Heo <tj@kernel.org>
Thu, 14 Apr 2022 08:44:50 +0000 (11:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Apr 2022 12:18:41 +0000 (14:18 +0200)
commit598a22a077a8edb95a4cf45ba64bcc5ab7c2e01f
tree0ec9850add80bbb70c1010dac20079539795f275
parenta3f6c5949f66578b5f2d433b13409db5b94c695c
selftests: cgroup: Test open-time cgroup namespace usage for migration checks

commit bf35a7879f1dfb0d050fe779168bcf25c7de66f5 upstream.

When a task is writing to an fd opened by a different task, the perm check
should use the cgroup namespace of the latter task. Add a test for it.

Tested-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[OP: backport to v5.4: adjust context, add wait.h and fcntl.h includes]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/cgroup/test_core.c