From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH v4 0/4] serial: fix ioctl hangup race
Date: Thu, 10 Sep 2026 15:08:12 +0200 [thread overview]
Message-ID: <20260910130816.642699-1-johan@kernel.org> (raw)
The tty ioctls can race with hangup and end up calling into a tty
driver for a device that is already gone or powered down.
Included since v3 are also two related fixes for issues highlighted by
Sashiko.
Johan
Changes in v4
- include TIOCSETD which also access hardware
Changes in v3
- revert guards in uart_wait_modem_status()
- fix race in TIOCMIWAIT (new)
- abort TIOCMIWAIT on hangup (new)
Changes in v2
- include TIOCMIWAIT which also access hardware
- replace broken scoped_guard() construct in wait loop
Johan Hovold (4):
serial: revert guards in uart_wait_modem_status()
serial: fix ioctl hangup race
serial: fix TIOCMIWAIT race
serial: abort TIOCMIWAIT on hangup
drivers/tty/serial/serial_core.c | 59 ++++++++++++++++++++++----------
1 file changed, 41 insertions(+), 18 deletions(-)
--
2.55.0
next reply other threads:[~2026-09-10 13:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 13:08 Johan Hovold [this message]
2026-09-10 13:08 ` [PATCH v4 1/4] serial: revert guards in uart_wait_modem_status() Johan Hovold
2026-09-10 13:08 ` [PATCH v4 2/4] serial: fix ioctl hangup race Johan Hovold
2026-09-10 13:08 ` [PATCH v4 3/4] serial: fix TIOCMIWAIT race Johan Hovold
2026-09-10 13:08 ` [PATCH v4 4/4] serial: abort TIOCMIWAIT on hangup Johan Hovold
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=20260910130816.642699-1-johan@kernel.org \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@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
all inboxes | Powered by JetHome®