Skip to content
Browse files
char: lp: fix possible integer overflow in lp_setup()
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: Roee Hay <>
Cc: Ben Hutchings <>
Signed-off-by: Willy Tarreau <>
Signed-off-by: Greg Kroah-Hartman <>
  • Loading branch information
wtarreau authored and gregkh committed May 16, 2017
1 parent 2ea659a commit 3e21f4af170bebf47c187c1ff8bf155583c9f3b1
Showing 1 changed file with 5 additions and 1 deletion.
@@ -859,7 +859,11 @@ static int __init lp_setup (char *str)
} else if (!strcmp(str, "auto")) {
parport_nr[0] = LP_PARPORT_AUTO;
} else if (!strcmp(str, "none")) {
parport_nr[parport_ptr++] = LP_PARPORT_NONE;
if (parport_ptr < LP_NO)
parport_nr[parport_ptr++] = LP_PARPORT_NONE;
printk(KERN_INFO "lp: too many ports, %s ignored.\n",
} else if (!strcmp(str, "reset")) {
reset = 1;

0 comments on commit 3e21f4a

Please sign in to comment.