char: lp: fix possible integer overflow in lp_setup()
authorWilly Tarreau <w@1wt.eu>
Tue, 16 May 2017 17:18:55 +0000 (19:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 12:30:07 +0000 (14:30 +0200)
commitcda5c7e625cefed46311cb0b37816fb2ff42a8ee
treed1f606c3c23a69fd032e395e03234fa674b0cc45
parentea99c2248495b60a1f1075b670f426875cc8e189
char: lp: fix possible integer overflow in lp_setup()

commit 3e21f4af170bebf47c187c1ff8bf155583c9f3b1 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: Roee Hay <roee.hay@hcl.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/lp.c