Message ID | 1412888588-26755-6-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index b44dd49..8e5e0a9 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -4350,6 +4350,11 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, struct cgroup_subsys *ss; struct super_block *sb = root->sb; + /* Do not accept '\n' to prevent making /proc/<pid>/cgroup unparsable. + */ + if (strchr(dentry->d_name.name, '\n')) + return -EINVAL; + /* allocate the cgroup and its ID, 0 is reserved for the root */ cgrp = kzalloc(sizeof(*cgrp), GFP_KERNEL); if (!cgrp)