Commit fe20e581 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[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: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 80584ff3
...@@ -356,6 +356,10 @@ int param_set_copystring(const char *val, struct kernel_param *kp) ...@@ -356,6 +356,10 @@ int param_set_copystring(const char *val, struct kernel_param *kp)
{ {
struct kparam_string *kps = kp->arg; struct kparam_string *kps = kp->arg;
if (!val) {
printk(KERN_ERR "%s: missing param set value\n", kp->name);
return -EINVAL;
}
if (strlen(val)+1 > kps->maxlen) { if (strlen(val)+1 > kps->maxlen) {
printk(KERN_ERR "%s: string doesn't fit in %u chars.\n", printk(KERN_ERR "%s: string doesn't fit in %u chars.\n",
kp->name, kps->maxlen-1); kp->name, kps->maxlen-1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment