Skip to content

Commit 57aa9f2

Browse files
Qiujun Huangjhovold
authored andcommitted
USB: serial: io_edgeport: fix slab-out-of-bounds read in edge_interrupt_callback
Fix slab-out-of-bounds read in the interrupt-URB completion handler. The boundary condition should be (length - 1) as we access data[position + 1]. Reported-and-tested-by: [email protected] Signed-off-by: Qiujun Huang <[email protected]> Fixes: 1da177e ("Linux-2.6.12-rc2") Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
1 parent dfee7e2 commit 57aa9f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/serial/io_edgeport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ static void edge_interrupt_callback(struct urb *urb)
710710
/* grab the txcredits for the ports if available */
711711
position = 2;
712712
portNumber = 0;
713-
while ((position < length) &&
713+
while ((position < length - 1) &&
714714
(portNumber < edge_serial->serial->num_ports)) {
715715
txCredits = data[position] | (data[position+1] << 8);
716716
if (txCredits) {

0 commit comments

Comments
 (0)