serial: 8250_bcm7271: fix use-after-free in brcmuart_remove()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 41a469482de257ea8db43cf74b6311bd055de030 · < 0794ba5332754866b2f1c0cca668775be3ffcf0a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
serial: 8250_bcm7271: fix use-after-free in brcmuart_remove()
brcmuart_handle_irq() starts priv->hrt to work around a receive-timeout quirk of the 8250 core when hardware flow control is enabled; the timer callback brcmuart_hrtimer_func() dereferences priv.
brcmuart_remove() cancels the hrtimer before it unregisters the port, so a receive-timeout interrupt that arrives in between re-arms the timer. After devm frees priv, the callback runs on freed memory.
Unregister the port before cancelling the hrtimer. serial8250_unregister_port() shuts the port down and frees its IRQ, so brcmuart_handle_irq() can no longer restart the timer, and the final hrtimer_cancel() drains any timer that was armed before or during the unregister.
This issue was found by an in-house static analysis tool.
From the CVE record · Linux
The Linux kernel’s 8250_bcm7271 serial driver has a use-after-free during port removal. A receive-timeout interrupt arriving between timer cancellation and port unregistration can restart the timer, causing its callback to access freed memory. The input does not establish whether an attacker can trigger this or whether authentication or user interaction is required.
Engineers running Linux kernels with the 8250_bcm7271 serial driver should check their kernel versions against the vendor advisory; affected versions were not provided.