tty: n_gsm: fix race condition in status line change on dead connections
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
d834aba5f30d9a6f98f4ca1eb07e501f1989331c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tty: n_gsm: fix race condition in status line change on dead connections
gsm_cleanup_mux() cleans up the gsm by closing all DLCIs, stopping all timers, removing the virtual tty devices and clearing the data queues. This procedure, however, may cause subsequent changes of the virtual modem status lines of a DLCI. More data is being added the outgoing data queue and the deleted kick timer is restarted to handle this. At this point many resources have already been removed by the cleanup procedure. Thus, a kernel panic occurs.
Fix this by proving in gsm_modem_update() that the cleanup procedure has not been started and the mux is still alive.
Note that writing to a virtual tty is already protected by checks against the DLCI specific connection state.
From the CVE record · Linux
A race in the Linux kernel’s n_gsm component can occur when a virtual modem status line changes during connection cleanup. The race can restart a timer after resources have been removed, causing a kernel panic. The input does not specify attacker access requirements or whether user interaction is needed.
Anyone running a Linux kernel with the affected n_gsm code should check their version; affected versions are not specified.