mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
USB: serial: keyspan: fix missing indat transfer sanity check
Add the missing sanity check on the size of usa49wg indat transfers to
avoid parsing stale or uninitialised slab data.
Fixes: 0ca1268e10 ("USB Serial Keyspan: add support for USA-49WG & USA-28XG")
Cc: stable@vger.kernel.org # 2.6.23
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
cb3560e8ea
commit
ab8336a7e4
|
|
@ -1187,6 +1187,10 @@ static void usa49wg_indat_callback(struct urb *urb)
|
|||
len = 0;
|
||||
|
||||
while (i < urb->actual_length) {
|
||||
if (urb->actual_length - i < 3) {
|
||||
dev_warn_ratelimited(&urb->dev->dev, "malformed indat packet\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check port number from message */
|
||||
if (data[i] >= serial->num_ports) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user