cgroups: skip and warn about invalid file descriptors

parent 1d544612
...@@ -1305,6 +1305,9 @@ static int chown_cgroup_wrapper(void *data) ...@@ -1305,6 +1305,9 @@ static int chown_cgroup_wrapper(void *data)
for (int i = 0; arg->hierarchies[i]; i++) { for (int i = 0; arg->hierarchies[i]; i++) {
int dirfd = arg->hierarchies[i]->dfd_con; int dirfd = arg->hierarchies[i]->dfd_con;
if (dirfd < 0)
return syserrno_set(-EBADF, "Invalid cgroup file descriptor");
(void)fchowmodat(dirfd, "", destuid, nsgid, 0775); (void)fchowmodat(dirfd, "", destuid, nsgid, 0775);
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment