Re: [PATCH] USB: cdc-acm: refuse writes after disconnect

From: Oliver Neukum

Date: Thu Nov 19 2026 - 03:25:06 EST


On 18.11.26 15:56, William A. Kennington III wrote:

Pin acm->data alongside acm->control until acm_port_destruct() so the
unlocked dev_vdbg() in acm_tty_write() stays valid across disconnect,
check acm->disconnected at the start of the write_lock critical section,
report zero room in acm_tty_write_room() once disconnected, and set
acm->disconnected under write_lock in acm_disconnect() so any concurrent
writer finishes before the URBs are poisoned and the buffers are freed.
Hi,

thank you for the patch. It raises a question, though.
It is not clear to me when you use READ_ONCE/WRITE_ONCE
and when you touch the disconnected flag directly.

Regards
Oliver