======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz-executor/8989 is trying to acquire lock:
ffff888028ac89b0 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:376 [inline]
ffff888028ac89b0 (&q->queue_lock){..-.}-{2:2}, at: throtl_pending_timer_fn+0x111/0x1dd0 block/blk-throttle.c:1209
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/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
__sanitizer_cov_trace_pc+0x4/0x60 kernel/kcov.c:208
get_counters net/ipv4/netfilter/ip_tables.c:759 [inline]
alloc_counters+0x3fe/0x720 net/ipv4/netfilter/ip_tables.c:806
copy_entries_to_user net/ipv4/netfilter/ip_tables.c:823 [inline]
get_entries net/ipv4/netfilter/ip_tables.c:1022 [inline]
do_ipt_get_ctl+0xa8e/0x11a0 net/ipv4/netfilter/ip_tables.c:1667
nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116
ip_getsockopt+0x19b/0x230 net/ipv4/ip_sockglue.c:1826
__sys_getsockopt+0x1b0/0x230 net/socket.c:2332
__do_sys_getsockopt net/socket.c:2347 [inline]
__se_sys_getsockopt net/socket.c:2344 [inline]
__x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2344
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
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-executor/8989:
#0: ffff88814c4c6308 (&xt[i].mutex){+.+.}-{3:3}, at: xt_find_table_lock+0x5e/0x360 net/netfilter/x_tables.c:1265
#1: ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xcf/0x670 kernel/time/timer.c:1698
stack backtrace:
CPU: 0 PID: 8989 Comm: syz-executor Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/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:get_current arch/x86/include/asm/current.h:15 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x4/0x60 kernel/kcov.c:211
Code: 00 00 00 00 00 90 53 48 89 fb e8 17 00 00 00 48 8b 3d 00 db 9f 0d 48 89 de 5b e9 f7 98 50 00 00 00 cc cc 00 00 cc 48 8b 04 24 <65> 48 8b 0d 94 06 80 7e 65 8b 15 95 06 80 7e 81 e2 00 01 ff 00 74
RSP: 0018:ffffc900031e78d8 EFLAGS: 00000246
RAX: ffffffff88e088fe RBX: 0000000000015760 RCX: 0000000000000000
RDX: ffff8880321e3c00 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900031e7a10 R08: ffffffff91b622c7 R09: 1ffffffff236c458
R10: dffffc0000000000 R11: fffffbfff236c459 R12: ffff8880b8c39d20
R13: 1ffff9200063cf2c R14: 1ffff110171873a4 R15: dffffc0000000000
get_counters net/ipv4/netfilter/ip_tables.c:759 [inline]
alloc_counters+0x3fe/0x720 net/ipv4/netfilter/ip_tables.c:806
copy_entries_to_user net/ipv4/netfilter/ip_tables.c:823 [inline]
get_entries net/ipv4/netfilter/ip_tables.c:1022 [inline]
do_ipt_get_ctl+0xa8e/0x11a0 net/ipv4/netfilter/ip_tables.c:1667
nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116
ip_getsockopt+0x19b/0x230 net/ipv4/ip_sockglue.c:1826
__sys_getsockopt+0x1b0/0x230 net/socket.c:2332
__do_sys_getsockopt net/socket.c:2347 [inline]
__se_sys_getsockopt net/socket.c:2344 [inline]
__x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2344
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
RIP: 0033:0x7f4ee57a12ea
Code: 48 83 ec 10 89 d2 48 63 ff 45 31 c9 6a 2a 45 31 c0 31 c9 e8 d8 99 fb ff 48 83 c4 18 c3 0f 1f 00 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 06 c3 0f 1f 44 00 00 48 c7 c2 e8 ff ff ff f7
RSP: 002b:00007ffc6d535418 EFLAGS: 00000216 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 00007ffc6d5354a0 RCX: 00007f4ee57a12ea
RDX: 0000000000000041 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007ffc6d53543c R09: 0000000000000000
R10: 00007ffc6d5354a0 R11: 0000000000000216 R12: 00007f4ee59f9ac0
R13: 00007ffc6d53543c R14: 0000000000000000 R15: 00007f4ee59fa180
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: 00 00 add %al,(%rax)
4: 00 90 53 48 89 fb add %dl,-0x476b7ad(%rax)
a: e8 17 00 00 00 call 0x26
f: 48 8b 3d 00 db 9f 0d mov 0xd9fdb00(%rip),%rdi # 0xd9fdb16
16: 48 89 de mov %rbx,%rsi
19: 5b pop %rbx
1a: e9 f7 98 50 00 jmp 0x509916
1f: 00 00 add %al,(%rax)
21: cc int3
22: cc int3
23: 00 00 add %al,(%rax)
25: cc int3
26: 48 8b 04 24 mov (%rsp),%rax
* 2a: 65 48 8b 0d 94 06 80 mov %gs:0x7e800694(%rip),%rcx # 0x7e8006c6 <-- trapping instruction
31: 7e
32: 65 8b 15 95 06 80 7e mov %gs:0x7e800695(%rip),%edx # 0x7e8006ce
39: 81 e2 00 01 ff 00 and $0xff0100,%edx
3f: 74 .byte 0x74