]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: libertas: don't kill URBs in interrupt context
authorHeitor Alves de Siqueira <halves@igalia.com>
Fri, 13 Mar 2026 21:27:58 +0000 (18:27 -0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 19 Mar 2026 08:07:55 +0000 (09:07 +0100)
Serialization for the TX path was enforced by calling
usb_kill_urb()/usb_kill_anchored_urbs(), to prevent transmission before
a previous URB was completed. usb_tx_block() can be called from
interrupt context (e.g. in the HCD giveback path), so we can't always
use it to kill in-flight URBs.

Prevent sleeping during interrupt context by checking the tx_submitted
anchor for existing URBs. We now return -EBUSY, to indicate there's
a pending request.

Reported-by: syzbot+74afbb6355826ffc2239@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=74afbb6355826ffc2239
Fixes: d66676e6ca96 ("wifi: libertas: fix WARNING in usb_tx_block")
Signed-off-by: Heitor Alves de Siqueira <halves@igalia.com>
Link: https://patch.msgid.link/20260313-libertas-usb-anchors-v1-2-915afbe988d7@igalia.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/marvell/libertas/if_usb.c

index 71fa38ef2c966dc30759a27d7631d0e06fd16511..176f2106bab6f8d2b71bbd8226867c5a61e43771 100644 (file)
@@ -426,7 +426,12 @@ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb
                goto tx_ret;
        }
 
-       usb_kill_anchored_urbs(&cardp->tx_submitted);
+       /* check if there are pending URBs */
+       if (!usb_anchor_empty(&cardp->tx_submitted)) {
+               lbs_deb_usbd(&cardp->udev->dev, "%s failed: pending URB\n", __func__);
+               ret = -EBUSY;
+               goto tx_ret;
+       }
 
        usb_fill_bulk_urb(cardp->tx_urb, cardp->udev,
                          usb_sndbulkpipe(cardp->udev,