projects
/
wrapfs-5.3.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a4ceab
)
USB: serial: whiteheat: fix potential slab corruption
author
Johan Hovold
<johan@kernel.org>
Tue, 29 Oct 2019 10:23:53 +0000
(11:23 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 6 Nov 2019 12:09:03 +0000
(13:09 +0100)
commit
1251dab9e0a2c4d0d2d48370ba5baa095a5e8774
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: 1da177e4c3f4 ("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>
drivers/usb/serial/whiteheat.c
patch
|
blob
|
history
diff --git
a/drivers/usb/serial/whiteheat.c
b/drivers/usb/serial/whiteheat.c
index 79314d8c94a446b9378aa7d5ebcb9a533e31cf1e..76cabcb30d21008c8008e1545cdfdd971203111f 100644
(file)
--- a/
drivers/usb/serial/whiteheat.c
+++ b/
drivers/usb/serial/whiteheat.c
@@
-559,6
+559,10
@@
static int firm_send_command(struct usb_serial_port *port, __u8 command,
command_port = port->serial->port[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);
command_info->command_finished = false;