======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
kworker/u4:1/11 is trying to acquire lock:
ffff888027a1b710 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline]
ffff888027a1b710 (&q->queue_lock){..-.}-{2:2}, at: throtl_pending_timer_fn+0x10e/0x1dd0 block/blk-throttle.c:1200
but task is already holding lock:
ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xcf/0x670 kernel/time/timer.c:1698
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 ((&sq->pending_timer)){+.-.}-{0:0}:
__timer_delete_sync+0xe1/0x2e0 kernel/time/timer.c:1556
del_timer_sync include/linux/timer.h:200 [inline]
throtl_pd_free+0x15/0x40 block/blk-throttle.c:493
blkcg_deactivate_policy+0x35c/0x5c0 block/blk-cgroup.c:1533
blk_throtl_exit+0xa6/0x140 block/blk-throttle.c:2415
blkcg_init_disk+0x37b/0x3f0 block/blk-cgroup.c:1310
__alloc_disk_node+0x2b3/0x570 block/genhd.c:1432
__blk_alloc_disk+0x2c/0x80 block/genhd.c:1471
alloc_dev drivers/md/dm.c:2055 [inline]
dm_create+0x46b/0xf90 drivers/md/dm.c:2259
dev_create+0x12e/0x2c0 drivers/md/dm-ioctl.c:875
ctl_ioctl drivers/md/dm-ioctl.c:2055 [inline]
dm_ctl_ioctl+0xa9c/0xec0 drivers/md/dm-ioctl.c:2077
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #1 (&blkcg->lock){....}-{2:2}:
__raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:351 [inline]
blkg_create+0xbe9/0x13c0 block/blk-cgroup.c:322
blkcg_init_disk+0x28c/0x3f0 block/blk-cgroup.c:1286
__alloc_disk_node+0x2b3/0x570 block/genhd.c:1432
__blk_alloc_disk+0x2c/0x80 block/genhd.c:1471
brd_alloc+0x377/0x760 drivers/block/brd.c:424
brd_init+0x125/0x1a5 drivers/block/brd.c:529
do_one_initcall+0x257/0x800 init/main.c:1270
do_initcall_level+0x13d/0x1ed init/main.c:1343
do_initcalls+0x4b/0x8a init/main.c:1359
kernel_init_freeable+0x401/0x5ab init/main.c:1598
kernel_init+0x19/0x1b0 init/main.c:1486
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
-> #0 (&q->queue_lock){..-.}-{2:2}:
check_prev_add kernel/locking/lockdep.c:3095 [inline]
check_prevs_add kernel/locking/lockdep.c:3214 [inline]
validate_chain kernel/locking/lockdep.c:3830 [inline]
__lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063
lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5678
__raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline]
_raw_spin_lock_irq+0xab/0xf0 kernel/locking/spinlock.c:170
spin_lock_irq include/linux/spinlock.h:376 [inline]
throtl_pending_timer_fn+0x10e/0x1dd0 block/blk-throttle.c:1200
call_timer_fn+0x1ac/0x670 kernel/time/timer.c:1701
expire_timers kernel/time/timer.c:1752 [inline]
__run_timers+0x56c/0x810 kernel/time/timer.c:2023
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:2036
handle_softirqs+0x291/0x910 kernel/softirq.c:596
__do_softirq kernel/softirq.c:630 [inline]
invoke_softirq kernel/softirq.c:470 [inline]
__irq_exit_rcu+0x13b/0x230 kernel/softirq.c:679
irq_exit_rcu+0x5/0x20 kernel/softirq.c:691
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691
constant_test_bit arch/x86/include/asm/bitops.h:207 [inline]
arch_test_bit arch/x86/include/asm/bitops.h:239 [inline]
_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline]
test_ti_thread_flag include/linux/thread_info.h:118 [inline]
need_resched include/linux/sched.h:2245 [inline]
mutex_spin_on_owner+0x1b3/0x340 kernel/locking/mutex.c:373
mutex_optimistic_spin kernel/locking/mutex.c:476 [inline]
__mutex_lock_common kernel/locking/mutex.c:607 [inline]
__mutex_lock+0x187/0xae0 kernel/locking/mutex.c:747
linkwatch_event+0xa/0x50 net/core/link_watch.c:263
process_one_work+0x8ab/0x1160 kernel/workqueue.c:2292
worker_thread+0xaf5/0x12a0 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
other info that might help us debug this:
Chain exists of:
&q->queue_lock --> &blkcg->lock --> (&sq->pending_timer)
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock((&sq->pending_timer));
lock(&blkcg->lock);
lock((&sq->pending_timer));
lock(&q->queue_lock);
*** DEADLOCK ***
4 locks held by kworker/u4:1/11:
#0: ffff888017479138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x7b4/0x1160 kernel/workqueue.c:2267
#1: ffffc90000107d00 ((linkwatch_work).work){+.+.}-{0:0}, at: process_one_work+0x7b4/0x1160 kernel/workqueue.c:2267
#2: ffffffff8dd550a8 (rtnl_mutex){+.+.}-{3:3}, at: linkwatch_event+0xa/0x50 net/core/link_watch.c:263
#3: ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xcf/0x670 kernel/time/timer.c:1698
stack backtrace:
CPU: 0 PID: 11 Comm: kworker/u4:1 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Workqueue: events_unbound linkwatch_event
Call Trace:
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2170
check_prev_add kernel/locking/lockdep.c:3095 [inline]
check_prevs_add kernel/locking/lockdep.c:3214 [inline]
validate_chain kernel/locking/lockdep.c:3830 [inline]
__lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063
lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5678
__raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline]
_raw_spin_lock_irq+0xab/0xf0 kernel/locking/spinlock.c:170
spin_lock_irq include/linux/spinlock.h:376 [inline]
throtl_pending_timer_fn+0x10e/0x1dd0 block/blk-throttle.c:1200
call_timer_fn+0x1ac/0x670 kernel/time/timer.c:1701
expire_timers kernel/time/timer.c:1752 [inline]
__run_timers+0x56c/0x810 kernel/time/timer.c:2023
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:2036
handle_softirqs+0x291/0x910 kernel/softirq.c:596
__do_softirq kernel/softirq.c:630 [inline]
invoke_softirq kernel/softirq.c:470 [inline]
__irq_exit_rcu+0x13b/0x230 kernel/softirq.c:679
irq_exit_rcu+0x5/0x20 kernel/softirq.c:691
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691
RIP: 0010:constant_test_bit arch/x86/include/asm/bitops.h:207 [inline]
RIP: 0010:arch_test_bit arch/x86/include/asm/bitops.h:239 [inline]
RIP: 0010:_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline]
RIP: 0010:test_ti_thread_flag include/linux/thread_info.h:118 [inline]
RIP: 0010:need_resched include/linux/sched.h:2245 [inline]
RIP: 0010:mutex_spin_on_owner+0x1b3/0x340 kernel/locking/mutex.c:373
Code: 65 4c 8b 2d 0f 14 9f 7e 4c 89 ef be 08 00 00 00 e8 f2 1d 70 00 4c 89 e8 48 c1 e8 03 80 3c 28 00 74 08 4c 89 ef e8 4d 1c 70 00 <49> f7 45 00 08 00 00 00 0f 85 2d 01 00 00 48 83 7c 24 10 00 4d 89
RSP: 0018:ffffc90000107a60 EFLAGS: 00000246
RAX: 1ffff11027fd3780 RBX: 1ffffffff1baaa08 RCX: ffffffff81635b3e
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88813fe9bc00
RBP: dffffc0000000000 R08: ffff88813fe9bc07 R09: 1ffff11027fd3780
R10: dffffc0000000000 R11: ffffed1027fd3781 R12: ffffffff8dd55040
R13: ffff88813fe9bc00 R14: ffffffff8dd55090 R15: ffff88802920bc00
mutex_optimistic_spin kernel/locking/mutex.c:476 [inline]
__mutex_lock_common kernel/locking/mutex.c:607 [inline]
__mutex_lock+0x187/0xae0 kernel/locking/mutex.c:747
linkwatch_event+0xa/0x50 net/core/link_watch.c:263
process_one_work+0x8ab/0x1160 kernel/workqueue.c:2292
worker_thread+0xaf5/0x12a0 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
----------------
Code disassembly (best guess):
0: 65 4c 8b 2d 0f 14 9f mov %gs:0x7e9f140f(%rip),%r13 # 0x7e9f1417
7: 7e
8: 4c 89 ef mov %r13,%rdi
b: be 08 00 00 00 mov $0x8,%esi
10: e8 f2 1d 70 00 call 0x701e07
15: 4c 89 e8 mov %r13,%rax
18: 48 c1 e8 03 shr $0x3,%rax
1c: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
20: 74 08 je 0x2a
22: 4c 89 ef mov %r13,%rdi
25: e8 4d 1c 70 00 call 0x701c77
* 2a: 49 f7 45 00 08 00 00 testq $0x8,0x0(%r13) <-- trapping instruction
31: 00
32: 0f 85 2d 01 00 00 jne 0x165
38: 48 83 7c 24 10 00 cmpq $0x0,0x10(%rsp)
3e: 4d rex.WRB
3f: 89 .byte 0x89