diff options
author | Johan Hovold <johan@kernel.org> | 2017-11-03 17:30:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-28 18:00:50 +0300 |
commit | eb281683621b71ab9710d9dccbbef0c2e1769c97 (patch) | |
tree | e0c2fe0401613f425edf067490108a0519915a9f /include | |
parent | 0ff3ab701963a845d52337ded7eebf2d1a14fe00 (diff) | |
download | linux-eb281683621b71ab9710d9dccbbef0c2e1769c97.tar.xz |
serdev: ttyport: add missing receive_buf sanity checks
The receive_buf tty-port callback should return the number of bytes
accepted and must specifically never return a negative errno (or a value
larger than the buffer size) to the tty layer.
A serdev driver not providing a receive_buf callback would currently
cause the flush_to_ldisc() worker to spin in a tight loop when the tty
buffer pointers are incremented with -EINVAL (-22) after data has been
received.
A serdev driver occasionally returning a negative errno (or a too large
byte count) could cause information leaks or crashes when accessing
memory outside the tty buffers in consecutive callbacks.
Fixes: cd6484e1830b ("serdev: Introduce new bus for serial attached devices")
Cc: stable <stable@vger.kernel.org> # 4.11
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions