Skip to content

serial: fix ioctl hangup race

Johan Hovold linux-serial lkml stable 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 0 repliesNew
  2. v34 patches 4 repliesSuperseded
  3. v21 patch 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch1 replySuperseded

Changes in v4 from the cover letter

- include TIOCSETD which also access hardware

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4serial: revert guards in uart_wait_modem_status()drivers/tty/serial/serial_core.c+7 -60 replies
2/4serial: fix ioctl hangup racedrivers/tty/serial/serial_core.c+29 -120 replies
3/4serial: fix TIOCMIWAIT racedrivers/tty/serial/serial_core.c+2 -20 replies
4/4serial: abort TIOCMIWAIT on hangupdrivers/tty/serial/serial_core.c+5 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/4] serial: fix ioctl hangup race

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(-)
Signature · 1 line
2.55.0