Skip to content

Commit

Permalink
[PATCH] fix kernel oops with badly formatted module option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Randy Dunlap authored and Linus Torvalds committed Apr 12, 2007
1 parent 80584ff commit fe20e58
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ int param_set_copystring(const char *val, struct kernel_param *kp)
{
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) {
printk(KERN_ERR "%s: string doesn't fit in %u chars.\n",
kp->name, kps->maxlen-1);
Expand Down

0 comments on commit fe20e58

Please sign in to comment.