From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>,
Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org, Johan Hovold <johan@kernel.org>
Subject: [PATCH 0/3] tty: fix input-speed handling
Date: Sun, 15 Jul 2018 15:39:32 +0200 [thread overview]
Message-ID: <20180715133935.24964-1-johan@kernel.org> (raw)
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
next reply other threads:[~2018-07-15 13:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-15 13:39 Johan Hovold [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180715133935.24964-1-johan@kernel.org \
--to=johan@kernel.org \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox