* + cgroups-save-space-for-the-terminator.patch added to -mm tree
@ 2010-07-12 20:13 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2010-07-12 20:13 UTC (permalink / raw)
To: mm-commits; +Cc: error27, bblum, kamezawa.hiroyu, lizf, menage, serge
The patch titled
cgroups: save space for the terminator
has been added to the -mm tree. Its filename is
cgroups-save-space-for-the-terminator.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: cgroups: save space for the terminator
From: Dan Carpenter <error27@gmail.com>
The original code didn't leave enough space for a NULL terminator. These
strings are copied with strcpy() into fixed length buffers in
cgroup_root_from_opts().
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Serge E. Hallyn <serge@hallyn.com>
Reviewd-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Ben Blum <bblum@andrew.cmu.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
kernel/cgroup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN kernel/cgroup.c~cgroups-save-space-for-the-terminator kernel/cgroup.c
--- a/kernel/cgroup.c~cgroups-save-space-for-the-terminator
+++ a/kernel/cgroup.c
@@ -1102,7 +1102,7 @@ static int parse_cgroupfs_options(char *
if (opts->release_agent)
return -EINVAL;
opts->release_agent =
- kstrndup(token + 14, PATH_MAX, GFP_KERNEL);
+ kstrndup(token + 14, PATH_MAX - 1, GFP_KERNEL);
if (!opts->release_agent)
return -ENOMEM;
} else if (!strncmp(token, "name=", 5)) {
@@ -1123,7 +1123,7 @@ static int parse_cgroupfs_options(char *
if (opts->name)
return -EINVAL;
opts->name = kstrndup(name,
- MAX_CGROUP_ROOT_NAMELEN,
+ MAX_CGROUP_ROOT_NAMELEN - 1,
GFP_KERNEL);
if (!opts->name)
return -ENOMEM;
_
Patches currently in -mm which might be from error27@gmail.com are
linux-next.patch
mtd-sst25l-check-for-null-consistently.patch
scsi-remove-superfluous-null-pointer-check-from-scsi_kill_request.patch
9p-strlen-doesnt-count-the-terminator.patch
autofs4-remove-unneeded-null-check-in-try_to_fill_dentry.patch
cgroups-save-space-for-the-terminator.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-12 20:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-12 20:13 + cgroups-save-space-for-the-terminator.patch added to -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox