linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] cgroup fixes for v5.13-rc5
@ 2021-06-10 14:26 Tejun Heo
  2021-06-10 19:18 ` pr-tracker-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2021-06-10 14:26 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, cgroups

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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [GIT PULL] cgroup fixes for v5.13-rc5
  2021-06-10 14:26 [GIT PULL] cgroup fixes for v5.13-rc5 Tejun Heo
@ 2021-06-10 19:18 ` pr-tracker-bot
  0 siblings, 0 replies; 2+ messages in thread
From: pr-tracker-bot @ 2021-06-10 19:18 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Linus Torvalds, linux-kernel, cgroups

The pull request you sent on Thu, 10 Jun 2021 10:26:06 -0400:

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

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/f09eacca59d27efc15001795c33dbc78ca070732

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-10 19:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 14:26 [GIT PULL] cgroup fixes for v5.13-rc5 Tejun Heo
2021-06-10 19:18 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).