USB: serial: ftdi_sio: fix modem-status error handling
authorJohan Hovold <johan@kernel.org>
Thu, 12 Jan 2017 13:56:11 +0000 (14:56 +0100)
committerJiri Slaby <jslaby@suse.cz>
Wed, 1 Mar 2017 19:27:42 +0000 (20:27 +0100)
commit164e029c1313e57dc7445abf2d38907e5a4612ca
tree564a16acfc5abad4f7452b687e9cce0d84b85c42
parentd6c4af18ba5edefe8c68724f3528760851d1de2b
USB: serial: ftdi_sio: fix modem-status error handling

commit 427c3a95e3e29e65f59d99aaf320d7506f3eed57 upstream.

Make sure to detect short responses when fetching the modem status in
order to avoid parsing uninitialised buffer data and having bits of it
leak to user space.

Note that we still allow for short 1-byte responses.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/usb/serial/ftdi_sio.c