Skip to content

USB: serial: io_edgeport: fixes and sync commands

Johan Hovold linux-usb lkml sashiko-reviews stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest12 patches 1 replyIn review
  2. v111 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- reorder fixes
- add open check to edge_write() to handle tty_wakeup() racing with close()
- use openPending flag to detect stray open responses and move termios change before fifo corruption fix to allow extending critical section
- fix command URB UAF separately from switch to synchronous commands (new patch)
- move MCR change after termios change to avoid taking mutex in atomic context
- free command buffers also on successful submission
- specify command timeout in milliseconds rather than jiffies

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12USB: serial: io_edgeport: fix NULL-deref on early statusdrivers/usb/serial/io_edgeport.c+5 -50 replies
2/12USB: serial: io_edgeport: fix potential close() use-after-freedrivers/usb/serial/io_edgeport.c+8 -00 replies
3/12USB: serial: io_edgeport: fix potential NULL-deref at opendrivers/usb/serial/io_edgeport.c+5 -50 replies
4/12USB: serial: io_edgeport: move initial termios update to open()drivers/usb/serial/io_edgeport.c+10 -540 replies
5/12USB: serial: io_edgeport: fix potential fifo corruptiondrivers/usb/serial/io_edgeport.c+14 -10 replies
6/12USB: serial: io_edgeport: fix potential use-after-free on disconnectdrivers/usb/serial/io_edgeport.c+6 -130 replies
7/12USB: serial: io_edgeport: serialise MCR accessesdrivers/usb/serial/io_edgeport.c+15 -00 replies
8/12USB: serial: io_edgeport: drop redundant sanity checksdrivers/usb/serial/io_edgeport.c+4 -250 replies
9/12USB: serial: io_edgeport: drop redundant open sanity checksdrivers/usb/serial/io_edgeport.c+0 -100 replies
10/12USB: serial: io_edgeport: deassert DTR/RTS on close() and B0drivers/usb/serial/io_edgeport.c+27 -31 reply
11/12USB: serial: io_edgeport: replace atomic command allocationsdrivers/usb/serial/io_edgeport.c+5 -60 replies
12/12USB: serial: io_edgeport: switch to synchronous commandsdrivers/usb/serial/io_edgeport.c+15 -840 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 00/12] USB: serial: io_edgeport: fixes and sync commands

This series fixes a NULL-deref triggered by syzbot, a memory corruption and a UAF flagged by Sashiko, and a NULL-deref and a UAF found through inspection.

Also add the missing serialisation for MCR, drop the modem lines on hangup and close, and switch to synchronous commands so that operations are serialised as expected.

Johan

Changes in v2:
- reorder fixes
- add open check to edge_write() to handle tty_wakeup() racing with close()
- use openPending flag to detect stray open responses and move termios change before fifo corruption fix to allow extending critical section
- fix command URB UAF separately from switch to synchronous commands (new patch)
- move MCR change after termios change to avoid taking mutex in atomic context
- free command buffers also on successful submission
- specify command timeout in milliseconds rather than jiffies

Johan Hovold (12):
USB: serial: io_edgeport: fix NULL-deref on early status
USB: serial: io_edgeport: fix potential close() use-after-free
USB: serial: io_edgeport: fix potential NULL-deref at open
USB: serial: io_edgeport: move initial termios update to open()
USB: serial: io_edgeport: fix potential fifo corruption
USB: serial: io_edgeport: fix potential use-after-free on disconnect
USB: serial: io_edgeport: serialise MCR accesses
USB: serial: io_edgeport: drop redundant sanity checks
USB: serial: io_edgeport: drop redundant open sanity checks
USB: serial: io_edgeport: deassert DTR/RTS on close() and B0
USB: serial: io_edgeport: replace atomic command allocations
USB: serial: io_edgeport: switch to synchronous commands

 drivers/usb/serial/io_edgeport.c | 302 +++++++++++--------------------
 1 file changed, 105 insertions(+), 197 deletions(-)
Signature · 1 line
2.55.0