2024-05-01 00:05:39

by Hillf Danton

[permalink] [raw]
Subject: Re: [syzbot] [wireless?] [usb?] INFO: trying to register non-static key in skb_dequeue (3)

On Tue, 30 Apr 2024 08:02:25 -0700
> syzbot found the following issue on:
>
> HEAD commit: 3f12222a4beb usb: dwc3: core: Fix compile warning on s390 ..
> git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=118eeccf180000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing

--- x/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ y/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -171,6 +171,7 @@ static int _rtl_usb_init_tx(struct ieee8
u32 i;
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
+ int err = 0;

rtlusb->max_bulk_out_size = IS_HIGH_SPEED_USB(rtlusb->udev)
? USB_HIGH_SPEED_BULK_SIZE
@@ -185,7 +186,8 @@ static int _rtl_usb_init_tx(struct ieee8
if (!ep_num) {
rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG,
"Invalid endpoint map setting!\n");
- return -EINVAL;
+ err = -EINVAL;
+ break;
}
}

@@ -203,7 +205,7 @@ static int _rtl_usb_init_tx(struct ieee8
skb_queue_head_init(&rtlusb->tx_skb_queue[i]);
init_usb_anchor(&rtlusb->tx_pending[i]);
}
- return 0;
+ return err;
}

static void _rtl_rx_work(struct tasklet_struct *t);
@@ -236,7 +238,7 @@ static int _rtl_usb_init(struct ieee8021
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb_priv *usb_priv = rtl_usbpriv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(usb_priv);
- int err;
+ int err, rc;
u8 epidx;
struct usb_interface *usb_intf = rtlusb->intf;
u8 epnums = usb_intf->cur_altsetting->desc.bNumEndpoints;
@@ -286,7 +288,9 @@ static int _rtl_usb_init(struct ieee8021
/* usb endpoint mapping */
err = rtlpriv->cfg->usb_interface_cfg->usb_endpoint_mapping(hw);
rtlusb->usb_mq_to_hwq = rtlpriv->cfg->usb_interface_cfg->usb_mq_to_hwq;
- _rtl_usb_init_tx(hw);
+ rc = _rtl_usb_init_tx(hw);
+ if (!err)
+ err = rc;
_rtl_usb_init_rx(hw);
return err;
}
--


2024-05-01 01:44:11

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [wireless?] [usb?] INFO: trying to register non-static key in skb_dequeue (3)

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: [email protected]

Tested on:

commit: ac6a205c usb: xhci: compact 'trb_in_td()' arguments
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=129f5c90980000
kernel config: https://syzkaller.appspot.com/x/.config?x=6fe204286ac73e15
dashboard link: https://syzkaller.appspot.com/bug?extid=2660b9135e6144ca41a5
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=120eae87180000

Note: testing is done by a robot and is best-effort only.