Commit f4615841 authored by Willy Tarreau's avatar Willy Tarreau Committed by Greg Kroah-Hartman

char: lp: fix possible integer overflow in lp_setup()

commit 3e21f4af upstream.

The lp_setup() code doesn't apply any bounds checking when passing
"lp=none", and only in this case, resulting in an overflow of the
parport_nr[] array. All versions in Git history are affected.
Reported-By: default avatarRoee Hay <roee.hay@hcl.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 941c4b3f
...@@ -859,7 +859,11 @@ static int __init lp_setup (char *str) ...@@ -859,7 +859,11 @@ static int __init lp_setup (char *str)
} else if (!strcmp(str, "auto")) { } else if (!strcmp(str, "auto")) {
parport_nr[0] = LP_PARPORT_AUTO; parport_nr[0] = LP_PARPORT_AUTO;
} else if (!strcmp(str, "none")) { } else if (!strcmp(str, "none")) {
parport_nr[parport_ptr++] = LP_PARPORT_NONE; if (parport_ptr < LP_NO)
parport_nr[parport_ptr++] = LP_PARPORT_NONE;
else
printk(KERN_INFO "lp: too many ports, %s ignored.\n",
str);
} else if (!strcmp(str, "reset")) { } else if (!strcmp(str, "reset")) {
reset = 1; reset = 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