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: 532d, last: 54d

Sample crash report:
usb 1-1: reset high-speed USB device number 2 using dummy_hcd
usb 1-1: device descriptor read/64, error -71
usb 1-1: Using ep0 maxpacket: 32
usb 1-1: unable to get BOS descriptor or descriptor too short
zd1211rw 1-1:5.118: phy1
zd1211rw 1-1:5.114: error ioread32(CR_REG1): -11
============================================
WARNING: possible recursive locking detected
5.10.0-rc7-syzkaller #0 Not tainted
--------------------------------------------
kworker/1:2/2618 is trying to acquire lock:
ffff888102cbdd10 (&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:
ffff888101d9dd10 (&chip->mutex){+.+.}-{3:3}, at: pre_reset+0x217/0x290 drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1504

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/1:2/2618:
 #0: ffff888103bff538 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff888103bff538 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline]
 #0: ffff888103bff538 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline]
 #0: ffff888103bff538 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline]
 #0: ffff888103bff538 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline]
 #0: ffff888103bff538 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work+0x821/0x1520 kernel/workqueue.c:2243
 #1: ffffc900001c7da8 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work+0x854/0x1520 kernel/workqueue.c:2247
 #2: ffff88810802a218 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:731 [inline]
 #2: ffff88810802a218 (&dev->mutex){....}-{3:3}, at: hub_event+0x1c5/0x42d0 drivers/usb/core/hub.c:5537
 #3: ffff8881013cd218 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:731 [inline]
 #3: ffff8881013cd218 (&dev->mutex){....}-{3:3}, at: __device_attach+0x7a/0x4a0 drivers/base/dd.c:887
 #4: ffff88810ed8c1a8 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:731 [inline]
 #4: ffff88810ed8c1a8 (&dev->mutex){....}-{3:3}, at: __device_attach+0x7a/0x4a0 drivers/base/dd.c:887
 #5: ffff888101d9dd10 (&chip->mutex){+.+.}-{3:3}, at: pre_reset+0x217/0x290 drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1504

stack backtrace:
CPU: 1 PID: 2618 Comm: kworker/1:2 Not tainted 5.10.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:118
 print_deadlock_bug kernel/locking/lockdep.c:2761 [inline]
 check_deadlock kernel/locking/lockdep.c:2804 [inline]
 validate_chain kernel/locking/lockdep.c:3595 [inline]
 __lock_acquire.cold+0x15e/0x3b0 kernel/locking/lockdep.c:4832
 lock_acquire kernel/locking/lockdep.c:5437 [inline]
 lock_acquire+0x288/0x700 kernel/locking/lockdep.c:5402
 __mutex_lock_common kernel/locking/mutex.c:956 [inline]
 __mutex_lock+0x134/0x10a0 kernel/locking/mutex.c:1103
 zd_chip_disable_rxtx+0x1c/0x40 drivers/net/wireless/zydas/zd1211rw/zd_chip.c:1465
 zd_op_stop+0x60/0x190 drivers/net/wireless/zydas/zd1211rw/zd_mac.c:343
 zd_usb_stop drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1479 [inline]
 pre_reset+0x19d/0x290 drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1502
 usb_reset_device+0x379/0x9a0 drivers/usb/core/hub.c:5959
 probe+0x10f/0x590 drivers/net/wireless/zydas/zd1211rw/zd_usb.c:1371
 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396
 really_probe+0x291/0xde0 drivers/base/dd.c:554
 driver_probe_device+0x26b/0x3d0 drivers/base/dd.c:738
 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:844
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431
 __device_attach+0x228/0x4a0 drivers/base/dd.c:912
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0xbb2/0x1ce0 drivers/base/core.c:2936
 usb_set_configuration+0x113c/0x1910 drivers/usb/core/message.c:2164
 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238
 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293
 really_probe+0x291/0xde0 drivers/base/dd.c:554
 driver_probe_device+0x26b/0x3d0 drivers/base/dd.c:738
 __device_attach_driver+0x1d1/0x290 drivers/base/dd.c:844
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431
 __device_attach+0x228/0x4a0 drivers/base/dd.c:912
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0xbb2/0x1ce0 drivers/base/core.c:2936
 usb_new_device.cold+0x71d/0xfe9 drivers/usb/core/hub.c:2555
 hub_port_connect drivers/usb/core/hub.c:5223 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5363 [inline]
 port_event drivers/usb/core/hub.c:5509 [inline]
 hub_event+0x2348/0x42d0 drivers/usb/core/hub.c:5591
 process_one_work+0x933/0x1520 kernel/workqueue.c:2272
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
 kthread+0x38c/0x460 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
zd1211rw 1-1:5.118: error ioread32(CR_REG1): -11
usb 1-1: reset high-speed USB device number 2 using dummy_hcd
usb 1-1: Using ep0 maxpacket: 32
usb 1-1: unable to get BOS descriptor or descriptor too short
ieee80211 phy2: Selected rate control algorithm 'minstrel_ht'
zd1211rw 1-1:5.57: phy2

Crashes (23):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
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/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