summaryrefslogtreecommitdiff
path: root/include/linux/soc
diff options
context:
space:
mode:
authorFan Wu <fanwu01@zju.edu.cn>2026-09-09 08:40:02 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-09-23 12:22:08 +0200
commit189b9dc8c96ec9486482f27c1372b04a7152175e (patch)
tree3b1c0c8cbdfcf7a747619a642ff6b0c7e0efcba2 /include/linux/soc
parent9d8955281d9229a899e2041659a59b389027b711 (diff)
downloadlinux-next-189b9dc8c96ec9486482f27c1372b04a7152175e.tar.gz
linux-next-189b9dc8c96ec9486482f27c1372b04a7152175e.zip
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. Fixes: 41a469482de2 ("serial: 8250: Add new 8250-core based Broadcom STB driver") Cc: stable@kernel.org Assisted-by: Codex:gpt-5.6 Co-developed-by: Song Li <songl@zju.edu.cn> Signed-off-by: Song Li <songl@zju.edu.cn> Signed-off-by: Fan Wu <fanwu01@zju.edu.cn> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20260909084002.686911-1-fanwu01@zju.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/soc')
0 files changed, 0 insertions, 0 deletions