mirror of
git://github.com/lxc/lxc
synced 2025-09-01 22:09:30 +00:00
cgroups: verify that hierarchies are non-empty
Fixes: #3881 Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
@@ -326,6 +326,9 @@ static inline int prepare_cgroup_ctx(struct cgroup_ops *ops,
|
||||
{
|
||||
__u32 idx;
|
||||
|
||||
if (!ops || !ops->hierarchies)
|
||||
return ret_errno(ENOENT);
|
||||
|
||||
for (idx = 0; ops->hierarchies[idx]; idx++) {
|
||||
if (idx >= CGROUP_CTX_MAX_FD)
|
||||
return ret_errno(E2BIG);
|
||||
|
Reference in New Issue
Block a user