From: sashiko-bot@kernel.org
To: "Aibing Chen" <chenaibing@cmss.chinamobile.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH net v4] net: hso: fix stashed tx skb leak and replay race
Date: Wed, 18 Nov 2026 14:29:31 +0000 [thread overview]
Message-ID: <sashiko-outbox-221207@kernel.org> (raw)
In-Reply-To: <20261118141658.1381-1-chenaibing@cmss.chinamobile.com>
> hso_net_start_xmit() stashes the skb in odev->skb_tx_buf and stops the
> queue when hso_get_activity() reports -EAGAIN, which happens when the
> USB device is suspended or no longer configured. If the interface is
> then brought down, or the device is disconnected, that skb is simply
> left behind: hso_net_close() and hso_free_net_device() never release
> it, and hso_net_open() clears the pointer, so the skb and its data
> buffer are leaked.
>
> hso_resume() loses a frame in the same way when the device is still not
> ready: it passes skb_tx_buf to hso_net_start_xmit() and then clears the
> pointer unconditionally, so a frame stashed again by that call is never
> freed.
>
> Take the stashed skb with xchg() in both paths so that only one of them
> can obtain it, serialize the replay in hso_resume() against
> hso_net_close() with a per-interface mutex, and take the netdev TX lock
> around the replay so that it is also serialized with the stash in
> hso_net_start_xmit(). The state check uses test_bit(HSO_NET_RUNNING),
> the bit that hso_net_open() and hso_net_close() maintain.
>
> Reported-by: syzbot+bf62ca9997f43d2fa521@syzkaller.appspotmail.com
> Link: https://lore.kernel.org/all/6af74e31.fe96acdb.12252b.0009.GAE@google.com/
> Fixes: 72dc1c096c70 ("HSO: add option hso driver")
> Fixes: c213f286f2cf ("[netdrvr] hso: dev_kfree_skb crash fix")
> Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118141658.1381-1-chenaibing@cmss.chinamobile.com?part=1
next prev parent reply other threads:[~2026-11-18 14:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 9:31 [PATCH] net: hso: fix tx skb leak when the device stops Aibing Chen
2026-11-15 9:31 ` sashiko-bot
2026-11-15 10:16 ` [PATCH v2] net: hso: fix tx skb leak and a race on the stashed skb Aibing Chen
2026-11-16 10:16 ` sashiko-bot
2026-11-16 10:23 ` netdev-bot+sashiko
2026-11-15 21:20 ` [PATCH] net: hso: fix tx skb leak when the device stops netdev-bot+sashiko
2026-11-17 8:47 ` [PATCH net v3] net: hso: fix stashed tx skb leak and replay race Aibing Chen
2026-11-18 8:47 ` sashiko-bot
2026-11-18 14:16 ` [PATCH net v4] " Aibing Chen
2026-11-18 14:29 ` sashiko-bot [this message]
2026-11-18 14:32 ` [PATCH net v3] " netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-221207@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=chenaibing@cmss.chinamobile.com \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox