Skip to content

Commit 1251dab

Browse files
jhovoldgregkh
authored andcommitted
USB: serial: whiteheat: fix potential slab corruption
Fix a user-controlled slab buffer overflow due to a missing sanity check on the bulk-out transfer buffer used for control requests. Fixes: 1da177e ("Linux-2.6.12-rc2") Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 54f83b8 commit 1251dab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/usb/serial/whiteheat.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,10 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command,
559559

560560
command_port = port->serial->port[COMMAND_PORT];
561561
command_info = usb_get_serial_port_data(command_port);
562+
563+
if (command_port->bulk_out_size < datasize + 1)
564+
return -EIO;
565+
562566
mutex_lock(&command_info->mutex);
563567
command_info->command_finished = false;
564568

0 commit comments

Comments
 (0)