Skip to content

tty: n_hdlc: fix hangup handling

Johan Hovold linux-serial lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3tty: n_hdlc: fix missing write() hangup checkdrivers/tty/n_hdlc.c+5 -00 replies
2/3tty: n_hdlc: fix read() hangup racedrivers/tty/n_hdlc.c+2 -20 replies
3/3tty: n_hdlc: fix read() hangup checkdrivers/tty/n_hdlc.c+2 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] tty: n_hdlc: fix hangup handling

An LLM incorrectly flagged three hangup issues in n_hdlc as leading to hangups stuck in uninterruptible sleep.

This used to be the case before commit c96cf923a98d ("tty: Don't block on IO when ldisc change is pending") which incidentally fixed the stuck hangup issues by turning tty_io_nonblock() into an indirect hangup check.

Since then read() and write() can return -EAGAIN also for files opened in blocking mode on ldisc changes, which looks questionable. This change was added to address a regression introduced by a series adding missing locking to tty_reopen() but should probably be reconsidered. [1]

This series addresses the underlying hangup issues and incorrect -EAGAIN on hangup meanwhile.

Johan

[1] https://lore.kernel.org/all/alpine.LRH.2.02.1809191330590.19146@file01.intranet.prod.int.rdu2.redhat.com/

Johan Hovold (3):
tty: n_hdlc: fix missing write() hangup check
tty: n_hdlc: fix read() hangup race
tty: n_hdlc: fix read() hangup check

 drivers/tty/n_hdlc.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
Signature · 1 line
2.55.0