======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.7.792/7149 is trying to acquire lock:
ffff88802853f5c0 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline]
ffff88802853f5c0 (&q->queue_lock){..-.}-{2:2}, at: throtl_pending_timer_fn+0x111/0x1dd0 block/blk-throttle.c:1209
but task is already holding lock:
ffffc900001e0bc0 ((&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/0x30 block/blk-throttle.c:504
blkcg_deactivate_policy+0x35f/0x5d0 block/blk-cgroup.c:1542
blk_throtl_exit+0xa6/0x140 block/blk-throttle.c:2424
blkcg_init_disk+0x38d/0x400 block/blk-cgroup.c:1319
__alloc_disk_node+0x2b3/0x570 block/genhd.c:1432
__blk_alloc_disk+0x2c/0x80 block/genhd.c:1471
alloc_dev drivers/md/dm.c:2057 [inline]
dm_create+0x46b/0xf90 drivers/md/dm.c:2261
dev_create+0x12e/0x2c0 drivers/md/dm-ioctl.c:887
ctl_ioctl drivers/md/dm-ioctl.c:2070 [inline]
dm_ctl_ioctl+0xa9c/0xec0 drivers/md/dm-ioctl.c:2092
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/0x1390 block/blk-cgroup.c:322
blkcg_init_disk+0x272/0x400 block/blk-cgroup.c:1293
__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:1271
do_initcall_level+0x13d/0x1ed init/main.c:1344
do_initcalls+0x4b/0x8a init/main.c:1360
kernel_init_freeable+0x401/0x5ab init/main.c:1599
kernel_init+0x19/0x1b0 init/main.c:1487
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:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171
lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790
__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+0x111/0x1dd0 block/blk-throttle.c:1209
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
lockdep_unregister_key+0x4e8/0x550 kernel/locking/lockdep.c:6526
__qdisc_destroy+0x128/0x430 net/sched/sch_generic.c:1102
netdev_for_each_tx_queue include/linux/netdevice.h:2474 [inline]
dev_shutdown+0x91/0x440 net/sched/sch_generic.c:1486
unregister_netdevice_many_notify+0xa7e/0x1990 net/core/dev.c:11038
unregister_netdevice_many net/core/dev.c:11101 [inline]
unregister_netdevice_queue+0x2e5/0x330 net/core/dev.c:10984
unregister_netdevice include/linux/netdevice.h:3084 [inline]
__tun_detach+0xdb7/0x1590 drivers/net/tun.c:685
tun_detach drivers/net/tun.c:701 [inline]
tun_chr_close+0x109/0x1b0 drivers/net/tun.c:3506
__fput+0x20a/0x8b0 fs/file_table.c:320
task_work_run+0x1d0/0x260 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:180
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213
__syscall_exit_to_user_mode_work kernel/entry/common.c:295 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:306
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x68/0xd2
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 ***
2 locks held by syz.7.792/7149:
#0: ffffffff8ed6b9e8 (rtnl_mutex){+.+.}-{3:3}, at: tun_detach drivers/net/tun.c:698 [inline]
#0: ffffffff8ed6b9e8 (rtnl_mutex){+.+.}-{3:3}, at: tun_chr_close+0x3d/0x1b0 drivers/net/tun.c:3506
#1: ffffc900001e0bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xcf/0x670 kernel/time/timer.c:1698
stack backtrace:
CPU: 1 PID: 7149 Comm: syz.7.792 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/15/2026
Call Trace:
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2215
check_prev_add kernel/locking/lockdep.c:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171
lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790
__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+0x111/0x1dd0 block/blk-throttle.c:1209
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:lockdep_unregister_key+0x4e8/0x550 kernel/locking/lockdep.c:6526
Code: 21 b1 91 48 c7 c6 50 c5 64 81 e8 c3 ac 07 00 e8 0e c0 07 00 e9 5c fc ff ff e8 34 93 d2 08 41 f7 c4 00 02 00 00 74 d1 fb 84 db <75> d0 eb e1 0f 0b eb 88 0f 0b e9 f8 fe ff ff 0f 0b e9 45 ff ff ff
RSP: 0018:ffffc9000333f900 EFLAGS: 00000246
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 7ed37aeea19a3800
RDX: 0000000000000001 RSI: ffffffff8aac29a0 RDI: ffffffff8afe72a0
RBP: ffffc9000333f9e0 R08: ffffffff91b1392f R09: 1ffffffff2362725
R10: dffffc0000000000 R11: fffffbfff2362726 R12: 0000000000000a07
R13: ffff88814c8be299 R14: ffffffff91b12198 R15: 1ffff92000667f24
__qdisc_destroy+0x128/0x430 net/sched/sch_generic.c:1102
netdev_for_each_tx_queue include/linux/netdevice.h:2474 [inline]
dev_shutdown+0x91/0x440 net/sched/sch_generic.c:1486
unregister_netdevice_many_notify+0xa7e/0x1990 net/core/dev.c:11038
unregister_netdevice_many net/core/dev.c:11101 [inline]
unregister_netdevice_queue+0x2e5/0x330 net/core/dev.c:10984
unregister_netdevice include/linux/netdevice.h:3084 [inline]
__tun_detach+0xdb7/0x1590 drivers/net/tun.c:685
tun_detach drivers/net/tun.c:701 [inline]
tun_chr_close+0x109/0x1b0 drivers/net/tun.c:3506
__fput+0x20a/0x8b0 fs/file_table.c:320
task_work_run+0x1d0/0x260 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:180
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213
__syscall_exit_to_user_mode_work kernel/entry/common.c:295 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:306
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f3555f9fb19
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffed3532558 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007ffed3532640 RCX: 00007f3555f9fb19
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 000000000002d467 R08: 0000000000000001 R09: 0000000000000000
R10: 0000001b30620000 R11: 0000000000000246 R12: 00007ffed3532680
R13: 00007f3556225fac R14: 000000000002d4aa R15: 00007f3556225fa0
----------------
Code disassembly (best guess), 1 bytes skipped:
0: b1 91 mov $0x91,%cl
2: 48 c7 c6 50 c5 64 81 mov $0xffffffff8164c550,%rsi
9: e8 c3 ac 07 00 call 0x7acd1
e: e8 0e c0 07 00 call 0x7c021
13: e9 5c fc ff ff jmp 0xfffffc74
18: e8 34 93 d2 08 call 0x8d29351
1d: 41 f7 c4 00 02 00 00 test $0x200,%r12d
24: 74 d1 je 0xfffffff7
26: fb sti
27: 84 db test %bl,%bl
* 29: 75 d0 jne 0xfffffffb <-- trapping instruction
2b: eb e1 jmp 0xe
2d: 0f 0b ud2
2f: eb 88 jmp 0xffffffb9
31: 0f 0b ud2
33: e9 f8 fe ff ff jmp 0xffffff30
38: 0f 0b ud2
3a: e9 45 ff ff ff jmp 0xffffff84