From: "Paul Menage" <menage@google.com>
To: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: containers@lists.osdl.org, linux-mm@kvack.org
Subject: Re: [PATCH] reject '\n' in a cgroup name
Date: Sun, 27 Jan 2008 23:49:04 -0800 [thread overview]
Message-ID: <6599ad830801272349p4b076ba5u8c491a92128fb1a9@mail.gmail.com> (raw)
In-Reply-To: <20080124052049.A2A8A1E3C0D@siro.lan>
Looks sensible - maybe we should ban all characters not in [a-zA-Z0-9._-] ?
Paul
On Jan 23, 2008 9:20 PM, YAMAMOTO Takashi <yamamoto@valinux.co.jp> wrote:
> hi,
>
> the following patch rejects '\n' in a cgroup name.
> otherwise /proc/$$/cgroup is not parsable.
>
> example:
> imawoto% cat /proc/$$/cgroup
> memory:/
> imawoto% mkdir -p "
> memory:/foo"
> imawoto% echo $$ >| "
> memory:/foo/tasks"
> imawoto% cat /proc/$$/cgroup
> memory:/
> memory:/foo
> imawoto%
>
> YAMAMOTO Takashi
>
>
> Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
> ---
>
> --- linux-2.6.24-rc8-mm1/kernel/cgroup.c.BACKUP 2008-01-23 14:43:29.000000000 +0900
> +++ linux-2.6.24-rc8-mm1/kernel/cgroup.c 2008-01-24 13:56:28.000000000 +0900
> @@ -2216,6 +2216,10 @@ static long cgroup_create(struct cgroup
> struct cgroup_subsys *ss;
> struct super_block *sb = root->sb;
>
> + /* reject a newline. otherwise /proc/$$/cgroup is not parsable. */
> + if (strchr(dentry->d_name.name, '\n'))
> + return -EINVAL;
> +
> cgrp = kzalloc(sizeof(*cgrp), GFP_KERNEL);
> if (!cgrp)
> return -ENOMEM;
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-01-28 7:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 5:20 [PATCH] reject '\n' in a cgroup name YAMAMOTO Takashi
2008-01-28 7:49 ` Paul Menage [this message]
2008-01-30 1:32 ` KAMEZAWA Hiroyuki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6599ad830801272349p4b076ba5u8c491a92128fb1a9@mail.gmail.com \
--to=menage@google.com \
--cc=containers@lists.osdl.org \
--cc=linux-mm@kvack.org \
--cc=yamamoto@valinux.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).