All of lore.kernel.org
 help / color / mirror / Atom feed
From: "William A. Kennington III" <william@wkennington.com>
To: Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Oliver Neukum <oneukum@suse.com>,
	Havard Skinnemoen <hskinnemoen@google.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	"William A. Kennington III" <william@wkennington.com>
Subject: Re: [PATCH] USB: cdc-acm: refuse writes after disconnect
Date: Sat, 21 Nov 2026 08:18:43 +0000	[thread overview]
Message-ID: <20261121081843.4065887-1-william@wkennington.com> (raw)
In-Reply-To: <awAtdlEpSLc1ges1@hovoldconsulting.com>

On Fri, Nov 20, 2026 at 12:22:30PM +0100, Johan Hovold wrote:
> Thanks for reporting this. I assume this is not something you actually
> hit yourself but rather something flagged by an LLM?

We actually hit this twice in a kdump I got from a machine doing some
usb reset testing. An LLM was used to squash the bug.

Trimmed dmesg and backtrace from the first vmcore (the
second crash three days later hit the same PC/LR at 51s uptime):

  [   57.197371] usb 1-1.4.1: USB disconnect, device number 9
  [   58.287013] usb 1-1.1.1: new high-speed USB device number 15 using npcm7xx-ehci
  [   58.599405] usb 1-1.1.1: Product: Zephyr CDC ACM sample
  [   58.676523] cdc_acm 1-1.1.1:1.0: ttyACM1: USB ACM device
  [   58.797838] cdc_acm 1-1.2.1:1.0: ttyACM2: USB ACM device
  [   59.026611] cdc_acm 1-1.4.1:1.0: ttyACM3: USB ACM device
  [   59.324421] IPv6: ADDRCONF(NETDEV_CHANGE): mctpserial0: link becomes ready
  [   59.378147] Unable to handle kernel paging request at virtual address ffffffc009fd5000
  ...
  [   59.437892] Internal error: Oops: 0000000096000047 [#1] SMP
  [   59.446523] CPU: 1 PID: 217 Comm: kworker/1:2 Kdump: loaded Not tainted 5.15.167-yocto-s-dirty-4ae9335 #1
  [   59.456085] Hardware name: XXX
  [   59.462436] Workqueue: events mctp_serial_tx_work
  [   59.474127] pc : __memcpy+0x7c/0x240
  [   59.477711] lr : acm_tty_write+0xec/0x1fc

   #10 [ffffff8001f03cd0] el1h_64_sync at ffffffc008011250
        PC: ffffffc0083e94bc  [memmove+124]
        LR: ffffffc00859ed50  [acm_tty_write+236]
   #11 [ffffff8001f03cf0] memmove at ffffffc0083e94b8
   #12 [ffffff8001f03d60] mctp_serial_tx_work at ffffffc008559924
   #13 [ffffff8001f03d90] process_one_work at ffffffc008059118

In both vmcores, tty ("ttyACM0") had count == 1, ldisc "mctp" attached,
acm->disconnected == true, and acm->wb[0].buf == 0xffffffc009fd5000
already unmapped by usb_free_coherent() in acm_disconnect().

> This isn't the right fix though as the line disciplines should not be
> calling back into the driver after a hangup (and this isn't cdc-acm
> specific).
>
> I've prepared a fix that restores the ldisc to N_TTY when a tty is
> reopened after a hangup instead.

Clearly your patch does it more cleanly :). Thanks for providing a clean
patch that looks like it does solve this issue

Thanks,
William

      parent reply	other threads:[~2026-11-21  8:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 14:56 [PATCH] USB: cdc-acm: refuse writes after disconnect William A. Kennington III
2026-11-18 15:09 ` sashiko-bot
2026-11-19  8:24 ` Oliver Neukum
2026-11-20  6:55   ` William A. Kennington III
2026-11-20 11:22 ` Johan Hovold
2026-11-20 13:45   ` Greg Kroah-Hartman
2026-11-21  8:18   ` William A. Kennington III [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261121081843.4065887-1-william@wkennington.com \
    --to=william@wkennington.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hskinnemoen@google.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.