lkml.org 
[lkml]   [2021]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[GIT PULL] cgroup fixes for v5.13-rc5
Hello, Linus.

This is a high priority but low risk fix for a cgroup1 bug where rename(2)
can change a cgroup's name to something which can break parsing of
/proc/PID/cgroup.

Thanks.

The following changes since commit 08b2b6fdf6b26032f025084ce2893924a0cdb4a2:

cgroup: fix spelling mistakes (2021-05-24 12:45:26 -0400)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-5.13-fixes

for you to fetch changes up to b7e24eb1caa5f8da20d405d262dba67943aedc42:

cgroup1: don't allow '\n' in renaming (2021-06-10 09:58:50 -0400)

----------------------------------------------------------------
Alexander Kuznetsov (1):
cgroup1: don't allow '\n' in renaming

kernel/cgroup/cgroup-v1.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index 8190b6bfc978..1f274d7fc934 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -820,6 +820,10 @@ static int cgroup1_rename(struct kernfs_node *kn, struct kernfs_node *new_parent
struct cgroup *cgrp = kn->priv;
int ret;

+ /* do not accept '\n' to prevent making /proc/<pid>/cgroup unparsable */
+ if (strchr(new_name_str, '\n'))
+ return -EINVAL;
+
if (kernfs_type(kn) != KERNFS_DIR)
return -ENOTDIR;
if (kn->parent != new_parent)
\
 
 \ /
  Last update: 2021-06-10 16:28    [W:0.351 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site