mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+74afbb6355826ffc2239@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [usb?] BUG: sleeping function called from invalid context in usb_tx_block
Date: Wed, 25 Feb 2026 12:58:05 +0800	[thread overview]
Message-ID: <20260225045807.386-1-hdanton@sina.com> (raw)
In-Reply-To: <699df457.050a0220.131eeb.0009.GAE@google.com>

> Date: Tue, 24 Feb 2026 10:56:23 -0800	[thread overview]
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    8bf22c33e7a1 Merge tag 'net-7.0-rc1' of git://git.kernel.o..
> git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> console output: https://syzkaller.appspot.com/x/log.txt?x=127b9722580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=1ff39736314a9939
> dashboard link: https://syzkaller.appspot.com/bug?extid=74afbb6355826ffc2239
> compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1561fffa580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1031795a580000

#syz test

--- x/drivers/net/wireless/marvell/libertas/if_usb.h
+++ y/drivers/net/wireless/marvell/libertas/if_usb.h
@@ -44,7 +44,7 @@ struct bootcmdresp
 /* USB card description structure*/
 struct if_usb_card {
 	struct usb_device *udev;
-	uint32_t model;  /* MODEL_* */
+	uint32_t tx_in_flight, model;  /* MODEL_* */
 	struct urb *rx_urb, *tx_urb;
 	struct lbs_private *priv;
 
--- x/drivers/net/wireless/marvell/libertas/if_usb.c
+++ y/drivers/net/wireless/marvell/libertas/if_usb.c
@@ -86,6 +86,7 @@ static void if_usb_write_bulk_callback(s
 {
 	struct if_usb_card *cardp = (struct if_usb_card *) urb->context;
 
+	cardp->tx_in_flight--;
 	/* handle the transmission complete validations */
 
 	if (urb->status == 0) {
@@ -425,8 +426,11 @@ static int usb_tx_block(struct if_usb_ca
 		ret = -ENODEV;
 		goto tx_ret;
 	}
-
-	usb_kill_urb(cardp->tx_urb);
+	if (cardp->tx_in_flight++) {
+		cardp->tx_in_flight--;
+		ret = -EBUSY;
+		goto tx_ret;
+	}
 
 	usb_fill_bulk_urb(cardp->tx_urb, cardp->udev,
 			  usb_sndbulkpipe(cardp->udev,
@@ -436,6 +440,7 @@ static int usb_tx_block(struct if_usb_ca
 	cardp->tx_urb->transfer_flags |= URB_ZERO_PACKET;
 
 	if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) {
+		cardp->tx_in_flight--;
 		lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed: %d\n", ret);
 	} else {
 		lbs_deb_usb2(&cardp->udev->dev, "usb_submit_urb success\n");
--

  reply	other threads:[~2026-02-25  4:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 18:56 syzbot
2026-02-25  4:58 ` Hillf Danton [this message]
2026-02-25  5:59   ` syzbot

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=20260225045807.386-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+74afbb6355826ffc2239@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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

all inboxes | Powered by JetHome®