mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-30 19:15:14 +00:00
[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
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue