CVE-2026-142985

Not scored yetLast modified Dec 3, 2026

Description

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():

__kfifo_alloc_node+0x10c/0x208 lib/kfifo.c:44 gs_open+0x144/0x514 drivers/usb/gadget/function/u_serial.c:636 tty_open+0x404/0x89c drivers/tty/tty_io.c:2137

and the tty core's close of the failed open then took port_lock through the NULL port:

BUG: unable to handle kernel paging request in gs_close KASAN: null-ptr-deref in range [0x00000000000003a0-0x00000000000003a7] Call trace: spin_lock_irq include/linux/spinlock.h:372 [inline] gs_close+0xac/0x65c drivers/usb/gadget/function/u_serial.c:698 tty_release+0x2c4/0xffc drivers/tty/tty_io.c:1745 tty_open+0x46c/0x89c drivers/tty/tty_io.c:2146

Return early instead. There is nothing to release when the open never got far enough to claim the port.

Unlike the check reverted by commit f6c7bc4a6823 ("Revert "usb: gadget: u_serial: Add null pointer check in gs_start_io""), this is not hiding a race: the tty core calls ->close() for an ->open() that failed by design, so driver_data is legitimately unset on that path.

Metrics

No CVSS score has been published yet.

Affected software

Source: the vendor's advisory (CNA). NVD analysis pending.

No affected versions have been published.

Timeline

Published
Dec 3, 2026
Last modified
Dec 3, 2026
NVD status
Received

Related CVEs from 2026

CVE-2026-142986In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_midi: fix UAF race during IN request handling f_midi_diCVE-2026-142987In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_mass_storage: take filesem in nofua store to fix backingCVE-2026-142988In the Linux kernel, the following vulnerability has been resolved: usb: xhci: disable the correct slot on alloc_dev failure xhci_alloc_deCVE-2026-142989In the Linux kernel, the following vulnerability has been resolved: usb: typec: ucsi: Set ucsi->connector before enabling notifications InCVE-2026-142990In the Linux kernel, the following vulnerability has been resolved: usb: usbtest: prevent divide by zero in simple_io() with zero length ACVE-2026-142991In the Linux kernel, the following vulnerability has been resolved: usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remoCVE-2026-142992In the Linux kernel, the following vulnerability has been resolved: USB: serial: oti6858: fix the teardown order in close The driver passeCVE-2026-142993In the Linux kernel, the following vulnerability has been resolved: USB: serial: garmin_gps: fix deadlock on reset request The garmin_gps CVE-2026-142994In the Linux kernel, the following vulnerability has been resolved: thunderbolt: stream: Undo more if the start fails If the receive buffeCVE-2026-142995In the Linux kernel, the following vulnerability has been resolved: serial: samsung: put the previous baud clock s3c24xx_serial_getclk() rCVE-2026-142996In the Linux kernel, the following vulnerability has been resolved: serial: samsung: don't leak the tty on an RX IRQ s3c24xx_serial_rx_chaCVE-2026-142997In the Linux kernel, the following vulnerability has been resolved: serial: imx: fix the tty reference of the wakeup event To report a wak
CVE-2026-142985: Unscored | Vulnix