Unverified Commit 5e3ec989 by Wolfgang Bumiller Committed by GitHub

Merge pull request #3884 from brauner/2021-06-28.fixes

cgroups: verify that hierarchies are non-empty
parents 0aa47c8f 414fbacc
...@@ -326,6 +326,9 @@ static inline int prepare_cgroup_ctx(struct cgroup_ops *ops, ...@@ -326,6 +326,9 @@ static inline int prepare_cgroup_ctx(struct cgroup_ops *ops,
{ {
__u32 idx; __u32 idx;
if (!ops || !ops->hierarchies)
return ret_errno(ENOENT);
for (idx = 0; ops->hierarchies[idx]; idx++) { for (idx = 0; ops->hierarchies[idx]; idx++) {
if (idx >= CGROUP_CTX_MAX_FD) if (idx >= CGROUP_CTX_MAX_FD)
return ret_errno(E2BIG); return ret_errno(E2BIG);
......
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