Netdev List
 help / color / mirror / Atom feed
From: raoxu <raoxu@uniontech.com>
To: andrew+netdev@lunn.ch
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, raoxu@uniontech.com,
	maciej.fijalkowski@intel.com, kuniyu@google.com,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH net v2] net: usb: ipheth: stop RX URB on ndo_stop
Date: Tue,  1 Sep 2026 13:06:04 +0800	[thread overview]
Message-ID: <351B4C70CB12AE0F+20260901050604.2523039-1-raoxu@uniontech.com> (raw)

From: Xu Rao <raoxu@uniontech.com>

ipheth_open() submits the RX URB, and a successful RX completion
resubmits it from ipheth_rcvbulk_callback(). ipheth_close() stops the
netdev queue and disables the carrier work, but leaves the RX URB
running.

After an administrative link down, an already submitted RX URB can
therefore complete, pass received packets to the networking stack, and
submit itself again even though the interface has been stopped.

Stop the RX URB from ndo_stop. Do not kill the TX URB: packets in a
successfully submitted TX URB have already been accounted as transmitted,
so let an in-flight TX complete normally after the queue has been
stopped.

usb_kill_urb() waits for a pending RX completion to finish and prevents
the completion handler from successfully resubmitting the URB.

Fixes: a19259c3d589 ("drivers/net/usb: Add new driver ipheth")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
---
v2:
- Kill only the RX URB and leave an in-flight TX URB to complete
  normally, as pointed out by Oliver Neukum.

 drivers/net/usb/ipheth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 2b490114d232..6b90fe1e0e38 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -505,6 +505,7 @@ static int ipheth_close(struct net_device *net)
 	 * it, so that such a schedule_delayed_work() is a no-op.
 	 */
 	disable_delayed_work_sync(&dev->carrier_work);
+	usb_kill_urb(dev->rx_urb);
 	return 0;
 }
 
-- 
2.50.1

             reply	other threads:[~2026-09-01  5:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  5:06 raoxu [this message]
2026-09-04 22:43 ` [PATCH net v2] net: usb: ipheth: stop RX URB on ndo_stop Jakub Kicinski

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=351B4C70CB12AE0F+20260901050604.2523039-1-raoxu@uniontech.com \
    --to=raoxu@uniontech.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    /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