USB: serial: fix potential heap buffer overflow
authorJohan Hovold <johan@kernel.org>
Wed, 27 Aug 2014 09:55:19 +0000 (11:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Aug 2014 20:23:52 +0000 (13:23 -0700)
commit5654699fb38512bdbfc0f892ce54fce75bdc2bab
treef5f75a1cdf069e08e83f4876b460243941043ecc
parentd979e9f9ecab04c1ecca741370e30a8a498893f5
USB: serial: fix potential heap buffer overflow

Make sure to verify the number of ports requested by subdriver to avoid
writing beyond the end of fixed-size array in interface data.

The current usb-serial implementation is limited to eight ports per
interface but failed to verify that the number of ports requested by a
subdriver (which could have been determined from device descriptors) did
not exceed this limit.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/usb-serial.c