[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071008071730.GA2979@darkstar.te-china.tietoenator.com>
Date: Mon, 8 Oct 2007 15:17:30 +0800
From: Dave Young <hidave.darkstar@...il.com>
To: xiyou.wangcong@...il.com
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
gregkh@...e.de
Subject: Re: [PATCH] param_sysfs_builtin memchr argument fix
Hi,
Thanks for comment.
fixed.
Regards
dave
-----
If memchr argument is longer than strlen(kp->name), there will be some
weird result.
Signed-off-by: Dave Young <hidave.darkstar@...il.com>
---
kernel/params.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff -upr linux/kernel/params.c linux.new/kernel/params.c
--- linux/kernel/params.c 2007-10-08 14:30:06.000000000 +0800
+++ linux.new/kernel/params.c 2007-10-08 15:13:04.000000000 +0800
@@ -592,11 +592,17 @@ static void __init param_sysfs_builtin(v
for (i=0; i < __stop___param - __start___param; i++) {
char *dot;
+ size_t kplen;
kp = &__start___param[i];
+ kplen = strlen(kp->name);
/* We do not handle args without periods. */
- dot = memchr(kp->name, '.', MAX_KBUILD_MODNAME);
+ if (kplen > MAX_KBUILD_MODNAME) {
+ DEBUGP("kernel parameter %s is too long\n", kp->name);
+ continue;
+ }
+ dot = memchr(kp->name, '.', kplen);
if (!dot) {
DEBUGP("couldn't find period in %s\n", kp->name);
continue;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists