|
@@ -4543,6 +4543,11 @@ static int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name,
|
|
struct cftype *base_files;
|
|
struct cftype *base_files;
|
|
int ssid, ret;
|
|
int ssid, ret;
|
|
|
|
|
|
|
|
+ /* Do not accept '\n' to prevent making /proc/<pid>/cgroup unparsable.
|
|
|
|
+ */
|
|
|
|
+ if (strchr(name, '\n'))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
parent = cgroup_kn_lock_live(parent_kn);
|
|
parent = cgroup_kn_lock_live(parent_kn);
|
|
if (!parent)
|
|
if (!parent)
|
|
return -ENODEV;
|
|
return -ENODEV;
|