diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c index 8e3f9b391e44..e9bee164bb70 100644 --- a/tools/testing/selftests/cgroup/test_core.c +++ b/tools/testing/selftests/cgroup/test_core.c @@ -794,10 +794,9 @@ static int lesser_ns_open_thread_fn(void *arg) static int test_cgcore_lesser_ns_open(const char *root) { static char stack[65536]; - const uid_t test_euid = 65534; /* usually nobody, any !root is fine */ int ret = KSFT_FAIL; char *cg_test_a = NULL, *cg_test_b = NULL; - char *cg_test_a_procs = NULL, *cg_test_b_procs = NULL; + char *cg_test_b_procs = NULL; int cg_test_b_procs_fd = -1; struct lesser_ns_open_thread_arg targ = { .fd = -1 }; pid_t pid; @@ -812,10 +811,9 @@ static int test_cgcore_lesser_ns_open(const char *root) if (!cg_test_a || !cg_test_b) goto cleanup; - cg_test_a_procs = cg_name(cg_test_a, "cgroup.procs"); cg_test_b_procs = cg_name(cg_test_b, "cgroup.procs"); - if (!cg_test_a_procs || !cg_test_b_procs) + if (!cg_test_b_procs) goto cleanup; if (cg_create(cg_test_a) || cg_create(cg_test_b)) @@ -824,10 +822,6 @@ static int test_cgcore_lesser_ns_open(const char *root) if (cg_enter_current(cg_test_b)) goto cleanup; - if (chown(cg_test_a_procs, test_euid, -1) || - chown(cg_test_b_procs, test_euid, -1)) - goto cleanup; - targ.path = cg_test_b_procs; pid = clone(lesser_ns_open_thread_fn, stack + sizeof(stack), CLONE_NEWCGROUP | CLONE_FILES | CLONE_VM | SIGCHLD, @@ -862,7 +856,6 @@ static int test_cgcore_lesser_ns_open(const char *root) if (cg_test_a) cg_destroy(cg_test_a); free(cg_test_b_procs); - free(cg_test_a_procs); free(cg_test_b); free(cg_test_a); return ret;