]> git.baikalelectronics.ru Git - kernel.git/commit
USB: serial: ch341: fix control-message error handling
authorJohan Hovold <johan@kernel.org>
Fri, 6 Jan 2017 18:15:18 +0000 (19:15 +0100)
committerJohan Hovold <johan@kernel.org>
Wed, 11 Jan 2017 11:08:57 +0000 (12:08 +0100)
commit1640e0a8406f01c41da94ccab47646f313d88638
tree212f96bdaa6e7612082a3d02d8506ec656364f70
parentf6337fc2f751e41000a40b2437fd91826e0fd41a
USB: serial: ch341: fix control-message error handling

A short control transfer would currently fail to be detected, something
which could lead to stale buffer data being used as valid input.

Check for short transfers, and make sure to log any transfer errors.

Note that this also avoids leaking heap data to user space (TIOCMGET)
and the remote device (break control).

Fixes: 0df80349c9f5 ("USB: Driver for CH341 USB-serial adaptor")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ch341.c