]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
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)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 1 Mar 2017 14:13:35 +0000 (07:13 -0700)
commit38f4ea3f7fa13d3ffbdbb9f0e142691f1f514483
treeb377ac9fe87de6ba2d9dc136b1c23b81422a5061
parent1e74ff2f1a6ab0c295dc4006a05f4daa84fdd809
USB: serial: ftdi_sio: fix modem-status error handling

BugLink: http://bugs.launchpad.net/bugs/1668993
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/usb/serial/ftdi_sio.c