[PATCH v3 0/4] serial: fix ioctl hangup race

From: Johan Hovold

Date: Mon Sep 07 2026 - 02:47:09 EST


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 in v3 are also two related fixes for issues highlighted by
Sashiko.

Johan


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 | 50 +++++++++++++++++++++++---------
1 file changed, 37 insertions(+), 13 deletions(-)

--
2.55.0