mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02:00
USB: serial: mct_u232: fix missing interrupt-in transfer sanity check
Add the missing sanity check on the size of interrupt-in transfers to
avoid parsing stale or uninitialised slab data (and leaking it to user
space).
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
915b36d701
commit
245aba83e3
|
|
@ -544,6 +544,11 @@ static void mct_u232_read_int_callback(struct urb *urb)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if (urb->actual_length < 2) {
|
||||
dev_warn_ratelimited(&port->dev, "short interrupt-in packet\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* The interrupt-in pipe signals exceptional conditions (modem line
|
||||
* signal changes and errors). data[0] holds MSR, data[1] holds LSR.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user