Vulnerability record
usb: gadget: u_serial: fix NULL deref in gs_close() after failed open
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: u_serial: fix NULL deref in gs_close() after failed open
gs_close() opens with
struct gs_port *port = tty->driver_data;
...
spin_lock_irq(&port->port_lock);
and never checks port. gs_open() assigns tty->driver_data only on the port.count 0 -> 1 edge, so any failure earlier in gs_open() leaves it NULL, and tty_open() calls tty_release(), and hence ->close(), when ->open() fails.
syzbot hit exactly this on arm64. Fault injection failed the kfifo_alloc() of the write buffer in gs_open():…
Remediation
No fixed version has been published for this vulnerability yet. Check the references below for vendor advisories, workarounds and mitigation guidance.
Sources