usb: gadget: u_serial: Fix race condition in TTY wakeup
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 35f95fd7f234d2b58803bab6f6ebd6bb988050a2 · < abf3620cba68e0e51e5c21054ce4f925f75b3661| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: u_serial: Fix race condition in TTY wakeup
A race condition occurs when gs_start_io() calls either gs_start_rx() or gs_start_tx(), as those functions briefly drop the port_lock for usb_ep_queue(). This allows gs_close() and gserial_disconnect() to clear port.tty and port_usb, respectively.
Use the null-safe TTY Port helper function to wake up TTY.
Example CPU1: CPU2: gserial_connect() // lock gs_close() // await lock gs_start_rx() // unlock usb_ep_queue() gs_close() // lock, reset port.tty and unlock gs_start_rx() // lock tty_wakeup() // NPE
From the CVE record · Linux
A race in the Linux kernel USB gadget serial driver can let close or disconnect clear a TTY pointer before a wakeup, causing a null pointer dereference. The input does not specify how an attacker could trigger the race or whether authentication or user interaction is required.
Engineers running the Linux kernel should check their versions against the vendor advisory; affected versions are not specified in the input.