From: zhengzongmin Date: Sun, 29 Nov 2026 18:59:36 +0800 Subject: [PATCH] USB: hso: fix skb leak on device close and teardown hso_net_start_xmit() stashes an outgoing skb in odev->skb_tx_buf when hso_get_activity() returns -EAGAIN. Neither hso_net_close() nor hso_free_net_device() frees that skb, so when the device is brought down or disconnected before it resumes, the skb and its head buffer are permanently leaked. syzbot hit this with an IPv6 Router Solicitation packet allocated by ndisc_send_rs(). Free the stashed skb in both paths. dev_kfree_skb() is NULL-safe, so no extra check is needed, and clear the pointer afterwards. Reported-by: syzbot+bf62ca9997f43d2fa521@syzkaller.appspotmail.com Signed-off-by: zhengzongmin --- drivers/net/usb/hso.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 71caa37..2f46d51 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -726,6 +726,11 @@ static int hso_net_close() /* no longer running */ clear_bit(HSO_NET_RUNNING, &odev->flags); + /* Release a packet stashed by hso_net_start_xmit() when the device + * was busy. Otherwise it leaks when the device is brought down. */ + dev_kfree_skb(odev->skb_tx_buf); + odev->skb_tx_buf = NULL; + hso_stop_net_device(odev->parent); /* done */ @@ -2357,6 +2362,11 @@ static void hso_free_net_device() if (hso_net->net) unregister_netdev(hso_net->net); + /* A stashed skb may survive hso_net_close() if the device was never + * brought up; make sure it is freed on the teardown path too. */ + dev_kfree_skb(hso_net->skb_tx_buf); + hso_net->skb_tx_buf = NULL; + /* start freeing */ for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) { usb_free_urb(hso_net->mux_bulk_rx_urb_pool[i]); -- 2.55.0.windows.3