USB: serial: whiteheat: fix potential slab corruption
commit1251dab9e0
upstream. Fix a user-controlled slab buffer overflow due to a missing sanity check on the bulk-out transfer buffer used for control requests. Fixes:1da177e4c3
("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20191029102354.2733-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0675c81abe
commit
906f9f252b
@ -575,6 +575,10 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command,
|
|||||||
|
|
||||||
command_port = port->serial->port[COMMAND_PORT];
|
command_port = port->serial->port[COMMAND_PORT];
|
||||||
command_info = usb_get_serial_port_data(command_port);
|
command_info = usb_get_serial_port_data(command_port);
|
||||||
|
|
||||||
|
if (command_port->bulk_out_size < datasize + 1)
|
||||||
|
return -EIO;
|
||||||
|
|
||||||
mutex_lock(&command_info->mutex);
|
mutex_lock(&command_info->mutex);
|
||||||
command_info->command_finished = false;
|
command_info->command_finished = false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user