xhci: dbgtty: Fix unregister on tty_register_driver() failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4521f16139409cdf9462c7325d43454462cff6c3 · < 33ed35ca629477f57e0dd1d77d6df96cf5a9eb55| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
xhci: dbgtty: Fix unregister on tty_register_driver() failure
If tty_register_driver() fails, it drops the reference, but fails to set the global dbc_tty_driver to NULL, causing the unregister to be called again when module exits.
On module unload dbc_tty_exit() only gates its cleanup on the driver pointer being non-NULL, so it operates on the already-freed driver:
module_init(xhci_hcd_init) xhci_hcd_init() xhci_dbc_init() [return value ignored] dbc_tty_init() tty_register_driver() fails tty_driver_kref_put() -> driver freed (dbc_tty_driver left dangling) ... module_exit(xhci_hcd_fini) xhci_hcd_fini() xhci_dbc_exit() dbc_tty_exit() if (dbc_tty_driver) -> true (dangling) tty_unregister_driver() -> use-after-free
From the CVE record · Linux
The Linux kernel's xhci dbgtty code can retain a dangling driver pointer if tty_register_driver() fails. A subsequent module unload can use the freed driver during cleanup; the input does not specify an attacker path, authentication requirements, or user interaction.
Engineers running Linux kernels with the xhci dbgtty component should check their builds; affected versions are not specified.