public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] tty: fix input-speed handling
@ 2018-07-15 13:39 Johan Hovold
  2018-07-15 13:39 ` [PATCH 1/3] tty: fix termios input-speed encoding Johan Hovold
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Johan Hovold @ 2018-07-15 13:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, Alan Cox, linux-kernel, Johan Hovold

Turns out we had some long-standing bugs in how we handle termios input
speeds. Specifically, we could end up setting the CIBAUD bits despite
the user leaving them cleared (i.e. B0, which means that we use the same
input and output rate). And once any of these bits were set we failed to
clear them on later updates, leading to incorrect rates being reported
back to user space.

Both issues could lead to an unexpected input rate being set on
subsequent termios updates unless the user actively clears CIBAUD.

Fortunately, no in-tree tty driver seems to use the input speed for
anything but to suppress line-setting updates, so the impact of this
should be mostly limited to the CIBAUD bits sometimes being incorrectly
set in returned termios data.

The final patch cleans up the conditional compilation of the BOTHER and
CIBAUD functionality by not having the latter depend on the former.

Johan


Johan Hovold (3):
  tty: fix termios input-speed encoding
  tty: fix termios input-speed encoding when using BOTHER
  tty: support CIBAUD without BOTHER

 drivers/tty/tty_baudrate.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-07-16 13:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-15 13:39 [PATCH 0/3] tty: fix input-speed handling Johan Hovold
2018-07-15 13:39 ` [PATCH 1/3] tty: fix termios input-speed encoding Johan Hovold
2018-07-15 13:39 ` [PATCH 2/3] tty: fix termios input-speed encoding when using BOTHER Johan Hovold
2018-07-15 13:39 ` [PATCH 3/3] tty: support CIBAUD without BOTHER Johan Hovold
2018-07-16 10:00   ` Greg Kroah-Hartman
2018-07-16 10:18     ` Johan Hovold
2018-07-16 10:44       ` Greg Kroah-Hartman
2018-07-16 13:13         ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox