syzbot


possible deadlock in zd_chip_disable_rxtx

Status: upstream: reported C repro on 2020/12/10 14:03
Reported-by: syzbot+0ec3d1a6cf1fbe79c153@syzkaller.appspotmail.com
First crash: 657d, last: 71d

Sample crash report:
zd1211rw 1-1:204.37: phy0
zd1211rw 1-1:204.37: error ioread32(CR_REG1): -11
usb 1-1: reset high-speed USB device number 2 using dummy_hcd
zd1211rw 1-1:204.191: phy1
zd1211rw 1-1:204.37: error ioread32(CR_REG1): -11
============================================
WARNING: possible recursive locking detected
5.19.0-rc4-syzkaller-00118-g8affe37c525d #0 Not tainted
--------------------------------------------
kworker/0:2/1140 is trying to acquire lock:
ffff88810a10df30 (&chip->mutex){+.+.}-{3:3}, at: zd_chip_disable_rxtx+0x1c/0x40 drivers/net/wireless/zydas/zd1211rw/zd_chip.c:1465

but task is already holding lock:
ffff88811d125f30 (&chip->mutex){+.+.}-{3:3}, at: pre_reset+0x217/0x290 drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1503

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&chip->mutex);
  lock(&chip->mutex);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

6 locks held by kworker/0:2/1140:
 #0: ffff888109c17138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff888109c17138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff888109c17138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
 #0: ffff888109c17138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
 #0: ffff888109c17138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
 #0: ffff888109c17138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
 #1: ffffc900029cfda8 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
 #2: ffff88810f209190 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:835 [inline]
 #2: ffff88810f209190 (&dev->mutex){....}-{3:3}, at: hub_event+0x1c1/0x4690 drivers/usb/core/hub.c:5681
 #3: ffff88811f899190 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:835 [inline]
 #3: ffff88811f899190 (&dev->mutex){....}-{3:3}, at: __device_attach+0x76/0x530 drivers/base/dd.c:964
 #4: ffff88811f89c118 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:835 [inline]
 #4: ffff88811f89c118 (&dev->mutex){....}-{3:3}, at: __device_attach+0x76/0x530 drivers/base/dd.c:964
 #5: ffff88811d125f30 (&chip->mutex){+.+.}-{3:3}, at: pre_reset+0x217/0x290 drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1503

stack backtrace:
CPU: 0 PID: 1140 Comm: kworker/0:2 Not tainted 5.19.0-rc4-syzkaller-00118-g8affe37c525d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022
Workqueue: usb_hub_wq hub_event
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2988 [inline]
 check_deadlock kernel/locking/lockdep.c:3031 [inline]
 validate_chain kernel/locking/lockdep.c:3816 [inline]
 __lock_acquire.cold+0x1f5/0x3b4 kernel/locking/lockdep.c:5053
 lock_acquire kernel/locking/lockdep.c:5665 [inline]
 lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747
 zd_chip_disable_rxtx+0x1c/0x40 drivers/net/wireless/zydas/zd1211rw/zd_chip.c:1465
 zd_op_stop+0x60/0x1a0 drivers/net/wireless/zydas/zd1211rw/zd_mac.c:343
 zd_usb_stop drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1478 [inline]
 pre_reset+0x19d/0x290 drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1501
 usb_reset_device+0x37d/0x9a0 drivers/usb/core/hub.c:6099
 probe+0x10f/0x590 drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1370
 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:555 [inline]
 really_probe+0x23e/0xb90 drivers/base/dd.c:634
 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:764
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:794
 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:917
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
 __device_attach+0x1e4/0x530 drivers/base/dd.c:989
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
 device_add+0xbda/0x1ea0 drivers/base/core.c:3417
 usb_set_configuration+0x101e/0x1900 drivers/usb/core/message.c:2170
 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238
 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:555 [inline]
 really_probe+0x23e/0xb90 drivers/base/dd.c:634
 __driver_probe_device+0x338/0x4d0 drivers/base/dd.c:764
 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:794
 __device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:917
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
 __device_attach+0x1e4/0x530 drivers/base/dd.c:989
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
 device_add+0xbda/0x1ea0 drivers/base/core.c:3417
 usb_new_device.cold+0x641/0x1091 drivers/usb/core/hub.c:2573
 hub_port_connect drivers/usb/core/hub.c:5353 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5497 [inline]
 port_event drivers/usb/core/hub.c:5653 [inline]
 hub_event+0x25d5/0x4690 drivers/usb/core/hub.c:5735
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2ef/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302
 </TASK>
zd1211rw 1-1:204.191: error ioread32(CR_REG1): -11
usb 1-1: reset high-speed USB device number 2 using dummy_hcd
ieee80211 phy2: Selected rate control algorithm 'minstrel_ht'
zd1211rw 1-1:204.98: phy2
usb 1-1: USB disconnect, device number 2
usb 1-1: new high-speed USB device number 3 using dummy_hcd
usb 1-1: config 204 has an invalid interface number: 37 but max is 2
usb 1-1: config 204 has an invalid interface association descriptor of length 2, skipping
usb 1-1: config 204 has an invalid interface number: 191 but max is 2
usb 1-1: config 204 has an invalid interface number: 98 but max is 2
usb 1-1: config 204 has no interface number 0
usb 1-1: config 204 has no interface number 1
usb 1-1: config 204 has no interface number 2
usb 1-1: config 204 interface 37 altsetting 7 has an invalid endpoint with address 0x80, skipping
usb 1-1: config 204 interface 37 altsetting 7 has an invalid endpoint with address 0xCB, skipping
usb 1-1: config 204 interface 37 altsetting 7 endpoint 0x4 has an invalid bInterval 0, changing to 7
usb 1-1: config 204 interface 37 altsetting 7 has an invalid endpoint with address 0x97, skipping
usb 1-1: config 204 interface 37 altsetting 7 has a duplicate endpoint with address 0x4, skipping
usb 1-1: config 204 interface 37 altsetting 7 has a duplicate endpoint with address 0x4, skipping
usb 1-1: config 204 interface 37 has no altsetting 0
usb 1-1: config 204 interface 191 has no altsetting 0
usb 1-1: config 204 interface 98 has no altsetting 0
usb 1-1: New USB device found, idVendor=054c, idProduct=0257, bcdDevice=25.0a
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: syz
usb 1-1: Manufacturer: syz
usb 1-1: SerialNumber: syz
usb 1-1: reset high-speed USB device number 3 using dummy_hcd
ieee80211 phy3: Selected rate control algorithm 'minstrel_ht'
zd1211rw 1-1:204.37: phy3
zd1211rw 1-1:204.37: error ioread32(CR_REG1): -11
usb 1-1: reset high-speed USB device number 3 using dummy_hcd
ieee80211 phy4: Selected rate control algorithm 'minstrel_ht'
zd1211rw 1-1:204.191: phy4
zd1211rw 1-1:204.37: error ioread32(CR_REG1): -11
zd1211rw 1-1:204.191: error ioread32(CR_REG1): -11
usb 1-1: reset high-speed USB device number 3 using dummy_hcd
ieee80211 phy5: Selected rate control algorithm 'minstrel_ht'
zd1211rw 1-1:204.98: phy5
usb 1-1: USB disconnect, device number 3

Crashes (28):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-usb 2022/07/10 17:58 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 8affe37c525d b5765a15 .config log report syz C possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2020/12/10 06:54 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 8010622c86ca c090b4da .config log report syz C
ci2-upstream-usb 2022/07/19 02:42 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 88a15fbb47db ff988920 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/07/12 14:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 8affe37c525d d91dd8ea .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/07/11 17:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 8affe37c525d f3f217ff .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/07/10 16:36 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 8affe37c525d b5765a15 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/04/02 11:03 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing e8b767f5e040 79a2a8fc .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/03/22 21:16 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 46d2c20b0b10 d88ef0c5 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/03/21 01:02 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 46d2c20b0b10 e2d91b1d .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/03/20 14:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 46d2c20b0b10 e2d91b1d .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/03/03 19:40 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 98d107b84614 45a13a73 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/02/06 23:36 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 2dac5d2864af a7dab638 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/02/06 10:01 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 2dac5d2864af a7dab638 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/02/03 01:09 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 554237f2bb62 4ebb2798 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/01/28 20:21 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 993a44fa85c1 495e00c5 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/01/19 04:00 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 455e73a07f6e 731a2d23 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/01/14 11:16 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 455e73a07f6e b8d780ab .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/01/10 09:36 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing cbb4f5f43599 2ca0d385 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/01/08 19:21 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing cbb4f5f43599 2ca0d385 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/01/01 23:34 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing db3e8244bd1c e1768e9c .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2022/01/01 08:39 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing db3e8244bd1c e1768e9c .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2021/12/24 14:51 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing ce1d37cb7697 6caa12e4 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2021/12/22 04:22 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing ce1d37cb7697 6caa12e4 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2021/12/15 18:58 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing cdf8e2de16c0 572bcb40 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2021/12/14 07:20 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing cdf8e2de16c0 5d14b1ea .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2021/10/29 22:08 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 79a4479a17b8 2353a3ec .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2021/09/09 02:20 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 4b93c544e90e e2776ee4 .config log report info possible deadlock in zd_chip_disable_rxtx
ci2-upstream-usb 2021/08/29 08:07 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 9c1587d99f93 be2c130d .config log report info possible deadlock in zd_chip_disable_rxtx
* Struck through repros no longer work on HEAD.