aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2007-04-12 02:28:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-12 18:31:41 -0400
commitfe20e581a72979917e35d5146458ceba79be391f (patch)
tree37c5d2639da3c4c1ad9aa5d1fc0e3fa124b1f071 /kernel/params.c
parent80584ff3b99c36ead7e130e453b3a48b18072d18 (diff)
[PATCH] fix kernel oops with badly formatted module option
Catch malformed kernel parameter usage of "param = value". Spaces are not supported, but don't cause a kernel fault on such usage, just report an error. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/params.c b/kernel/params.c
index e265b13195b1..1fc4ac746cd8 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -356,6 +356,10 @@ int param_set_copystring(const char *val, struct kernel_param *kp)
356{ 356{
357 struct kparam_string *kps = kp->arg; 357 struct kparam_string *kps = kp->arg;
358 358
359 if (!val) {
360 printk(KERN_ERR "%s: missing param set value\n", kp->name);
361 return -EINVAL;
362 }
359 if (strlen(val)+1 > kps->maxlen) { 363 if (strlen(val)+1 > kps->maxlen) {
360 printk(KERN_ERR "%s: string doesn't fit in %u chars.\n", 364 printk(KERN_ERR "%s: string doesn't fit in %u chars.\n",
361 kp->name, kps->maxlen-1); 365 kp->name, kps->maxlen-1);