[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>
This commit is contained in:
parent
80584ff3b9
commit
fe20e581a7
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue