Linux USB
 help / color / mirror / Atom feed
* [PATCH v2 0/2] tty: fix break race
@ 2026-09-03  4:24 Adriano Cordova
  2026-09-03  4:24 ` [PATCH v2 1/2] USB: serial: fix break_ctl() NULL-pointer dereference Adriano Cordova
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Adriano Cordova @ 2026-09-03  4:24 UTC (permalink / raw)
  To: gregkh
  Cc: johan, jirislaby, linux-usb, linux-serial, Adriano Cordova,
	syzbot+473d7477c523b41d4046

A timed break (TCSBRK/TCSBRKP) and the unconditional TIOCSBRK/TIOCCBRK
can race against USB disconnect and call break_ctl() after the device is
gone, dereferencing freed port data in keyspan_break_ctl().

Both patches are needed: the tty core must not issue break_ctl() to a
hung-up tty, and serial_break() must not call the driver after
disconnect. This is the same two-layer protection read and write already
use.

Changes since v1:
  - v1 https://lore.kernel.org/stable/20260903022452.111316-2-adrianox@gmail.com/T/#t
  - Proper check on the tty side, plus check on the USB side.
  - Tested syzbot

Reported-by: syzbot+473d7477c523b41d4046@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=473d7477c523b41d4046
Tested-by: syzbot+473d7477c523b41d4046@syzkaller.appspotmail.com

Adriano Cordova (2):
  USB: serial: fix break_ctl() NULL-pointer dereference
  tty: fix break race

 drivers/tty/tty_io.c            | 19 +++++++++++++++----
 drivers/usb/serial/usb-serial.c |  3 +++
 2 files changed, 18 insertions(+), 4 deletions(-)

-- 
2.51.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-03  6:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03  4:24 [PATCH v2 0/2] tty: fix break race Adriano Cordova
2026-09-03  4:24 ` [PATCH v2 1/2] USB: serial: fix break_ctl() NULL-pointer dereference Adriano Cordova
2026-09-03  4:24 ` [PATCH v2 2/2] tty: fix break race Adriano Cordova
2026-09-03  6:22 ` [PATCH v2 0/2] " Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox