syzbot


WARNING: bad unlock balance in blk_mq_update_tag_set_shared

Status: upstream: reported syz repro on 2024/11/06 02:29
Subsystems: block usb
[Documentation on labels]
Reported-by: syzbot+5007209c85ecdb50b5da@syzkaller.appspotmail.com
First crash: 4d23h, last: 2d19h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [block?] [usb?] WARNING: bad unlock balance in blk_mq_update_tag_set_shared 1 (3) 2024/11/06 04:39
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/11/06 03:52 21m ming.lei@redhat.com https://github.com/ming1/linux.git for-next OK log

Sample crash report:
=====================================
WARNING: bad unlock balance detected!
6.12.0-rc5-next-20241101-syzkaller #0 Not tainted
-------------------------------------
kworker/1:1/57 is trying to release lock (&q->q_usage_counter(queue)) at:
[<ffffffff8497aa7f>] blk_mq_update_tag_set_shared+0x27f/0x350 block/blk-mq.c:4131
but there are no more locks to release!

other info that might help us debug this:
7 locks held by kworker/1:1/57:
 #0: ffff888144aecd48 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3204 [inline]
 #0: ffff888144aecd48 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_scheduled_works+0x93b/0x1850 kernel/workqueue.c:3310
 #1: ffffc9000101fd00 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3205 [inline]
 #1: ffffc9000101fd00 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_scheduled_works+0x976/0x1850 kernel/workqueue.c:3310
 #2: ffff8880284ce190 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1014 [inline]
 #2: ffff8880284ce190 (&dev->mutex){....}-{4:4}, at: hub_event+0x1fe/0x5150 drivers/usb/core/hub.c:5849
 #3: ffff888032eab190 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1014 [inline]
 #3: ffff888032eab190 (&dev->mutex){....}-{4:4}, at: usb_disconnect+0x103/0x950 drivers/usb/core/hub.c:2295
 #4: ffff88807fd02160 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1014 [inline]
 #4: ffff88807fd02160 (&dev->mutex){....}-{4:4}, at: __device_driver_lock drivers/base/dd.c:1095 [inline]
 #4: ffff88807fd02160 (&dev->mutex){....}-{4:4}, at: device_release_driver_internal+0xce/0x7c0 drivers/base/dd.c:1293
 #5: ffff8880334480e0 (&shost->scan_mutex){+.+.}-{4:4}, at: scsi_remove_host+0x34/0x770 drivers/scsi/hosts.c:169
 #6: ffff8880334482d0 (&set->tag_list_lock){+.+.}-{4:4}, at: blk_mq_del_queue_tag_set block/blk-mq.c:4139 [inline]
 #6: ffff8880334482d0 (&set->tag_list_lock){+.+.}-{4:4}, at: blk_mq_exit_queue+0x1da/0x470 block/blk-mq.c:4461

stack backtrace:
CPU: 1 UID: 0 PID: 57 Comm: kworker/1:1 Not tainted 6.12.0-rc5-next-20241101-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: usb_hub_wq hub_event
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_unlock_imbalance_bug+0x25b/0x2d0 kernel/locking/lockdep.c:5287
 __lock_release kernel/locking/lockdep.c:5526 [inline]
 lock_release+0x5cb/0xa30 kernel/locking/lockdep.c:5870
 blk_unfreeze_release_lock block/blk.h:745 [inline]
 blk_mq_unfreeze_queue+0xd2/0x140 block/blk-mq.c:213
 blk_mq_update_tag_set_shared+0x27f/0x350 block/blk-mq.c:4131
 blk_mq_del_queue_tag_set block/blk-mq.c:4145 [inline]
 blk_mq_exit_queue+0x3a4/0x470 block/blk-mq.c:4461
 blk_mq_destroy_queue+0x1c1/0x220 block/blk-mq.c:4284
 __scsi_remove_device+0x1f9/0x3c0 drivers/scsi/scsi_sysfs.c:1512
 scsi_forget_host+0xcf/0x110 drivers/scsi/scsi_scan.c:2068
 scsi_remove_host+0x1dd/0x770 drivers/scsi/hosts.c:181
 quiesce_and_remove_host drivers/usb/storage/usb.c:949 [inline]
 usb_stor_disconnect+0x14e/0x1f0 drivers/usb/storage/usb.c:1178
 usb_unbind_interface+0x25e/0x940 drivers/usb/core/driver.c:461
 device_remove drivers/base/dd.c:569 [inline]
 __device_release_driver drivers/base/dd.c:1273 [inline]
 device_release_driver_internal+0x503/0x7c0 drivers/base/dd.c:1296
 bus_remove_device+0x34f/0x420 drivers/base/bus.c:576
 device_del+0x57a/0x9b0 drivers/base/core.c:3861
 usb_disable_device+0x3bf/0x850 drivers/usb/core/message.c:1418
 usb_disconnect+0x340/0x950 drivers/usb/core/hub.c:2304
 hub_port_connect drivers/usb/core/hub.c:5361 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
 port_event drivers/usb/core/hub.c:5821 [inline]
 hub_event+0x1ebc/0x5150 drivers/usb/core/hub.c:5903
 process_one_work kernel/workqueue.c:3229 [inline]
 process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310
 worker_thread+0x870/0xd30 kernel/workqueue.c:3391
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
usb 1-1: new full-speed USB device number 3 using dummy_hcd
usb 1-1: config 0 has an invalid interface number: 189 but max is 0
usb 1-1: config 0 has no interface number 0
usb 1-1: config 0 interface 189 altsetting 0 has an invalid descriptor for endpoint zero, skipping
usb 1-1: config 0 interface 189 altsetting 0 has an endpoint descriptor with address 0xE3, changing to 0x83
usb 1-1: config 0 interface 189 altsetting 0 endpoint 0x83 has invalid maxpacket 33307, setting to 64
usb 1-1: config 0 interface 189 altsetting 0 endpoint 0xB has invalid wMaxPacketSize 0
usb 1-1: config 0 interface 189 altsetting 0 has 3 endpoint descriptors, different from the interface descriptor's value: 2
usb 1-1: New USB device found, idVendor=07b4, idProduct=010a, bcdDevice= 1.02
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: config 0 descriptor??
ums-alauda 1-1:0.189: USB Mass Storage device detected
scsi host2: usb-storage 1-1:0.189
usb 1-1: USB disconnect, device number 3
usb 1-1: new full-speed USB device number 4 using dummy_hcd
usb 1-1: config 0 has an invalid interface number: 189 but max is 0
usb 1-1: config 0 has no interface number 0
usb 1-1: config 0 interface 189 altsetting 0 has an invalid descriptor for endpoint zero, skipping
usb 1-1: config 0 interface 189 altsetting 0 has an endpoint descriptor with address 0xE3, changing to 0x83
usb 1-1: config 0 interface 189 altsetting 0 endpoint 0x83 has invalid maxpacket 33307, setting to 64
usb 1-1: config 0 interface 189 altsetting 0 endpoint 0xB has invalid wMaxPacketSize 0
usb 1-1: config 0 interface 189 altsetting 0 has 3 endpoint descriptors, different from the interface descriptor's value: 2
usb 1-1: New USB device found, idVendor=07b4, idProduct=010a, bcdDevice= 1.02
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: config 0 descriptor??
ums-alauda 1-1:0.189: USB Mass Storage device detected
scsi host1: usb-storage 1-1:0.189

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/04 05:49 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/03 19:10 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/03 16:07 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/03 06:45 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/03 05:55 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/03 01:11 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/02 20:47 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/02 18:13 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/02 16:57 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/02 12:55 linux-next c88416ba074a f00eed24 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
2024/11/02 02:27 linux-next c88416ba074a f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in blk_mq_update_tag_set_shared
* Struck through repros no longer work on HEAD.