====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Tainted: G L ------------------------------------------------------ syz.2.646/9571 is trying to acquire lock: ffff80008fb355a8 (pcpu_alloc_mutex){+.+.}-{4:4}, at: pcpu_alloc_noprof+0x20c/0x1940 mm/percpu.c:1782 but task is already holding lock: ffff0000cc069ce0 (&q->q_usage_counter(io)#17){++++}-{0:0}, at: blk_mq_freeze_queue include/linux/blk-mq.h:954 [inline] ffff0000cc069ce0 (&q->q_usage_counter(io)#17){++++}-{0:0}, at: blk_throtl_init+0x238/0x3a8 block/blk-throttle.c:1323 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&q->q_usage_counter(io)#17){++++}-{0:0}: blk_alloc_queue+0x48c/0x54c block/blk-core.c:461 blk_mq_alloc_queue block/blk-mq.c:4415 [inline] __blk_mq_alloc_disk+0x124/0x304 block/blk-mq.c:4462 loop_add+0x324/0x880 drivers/block/loop.c:2050 loop_init+0xe8/0x10c drivers/block/loop.c:2289 do_one_initcall+0x248/0x9b4 init/main.c:1378 do_initcall_level+0x128/0x1c4 init/main.c:1440 do_initcalls+0x70/0xd0 init/main.c:1456 do_basic_setup+0x78/0x8c init/main.c:1475 kernel_init_freeable+0x268/0x39c init/main.c:1688 kernel_init+0x24/0x1dc init/main.c:1578 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844 -> #1 (fs_reclaim){+.+.}-{0:0}: __fs_reclaim_acquire mm/page_alloc.c:4301 [inline] fs_reclaim_acquire+0x8c/0x118 mm/page_alloc.c:4315 might_alloc include/linux/sched/mm.h:317 [inline] prepare_alloc_pages+0x13c/0x538 mm/page_alloc.c:4978 __alloc_frozen_pages_noprof+0x134/0x318 mm/page_alloc.c:5199 __alloc_pages_noprof+0x18/0x100 mm/page_alloc.c:5244 __alloc_pages_node_noprof include/linux/gfp.h:285 [inline] alloc_pages_node_noprof include/linux/gfp.h:312 [inline] pcpu_alloc_pages mm/percpu-vm.c:95 [inline] pcpu_populate_chunk+0x28c/0xa2c mm/percpu-vm.c:285 pcpu_alloc_noprof+0xb08/0x1940 mm/percpu.c:1870 xt_percpu_counter_alloc+0x14c/0x1ec net/netfilter/x_tables.c:1934 find_check_entry net/ipv4/netfilter/ip_tables.c:526 [inline] translate_table+0xe18/0x1824 net/ipv4/netfilter/ip_tables.c:716 ipt_register_table+0xe8/0x5c0 net/ipv4/netfilter/ip_tables.c:1742 iptable_nat_table_init+0x50/0x2ec net/ipv4/netfilter/iptable_nat.c:115 xt_find_table_lock+0x22c/0x3c8 net/netfilter/x_tables.c:1260 xt_request_find_table_lock+0x38/0x114 net/netfilter/x_tables.c:1285 get_info net/ipv4/netfilter/ip_tables.c:963 [inline] do_ipt_get_ctl+0x588/0x1008 net/ipv4/netfilter/ip_tables.c:1659 nf_getsockopt+0x264/0x284 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x1bc/0x328 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0xcc/0xe8 net/ipv4/tcp.c:4834 sock_common_getsockopt+0xa8/0xc4 net/core/sock.c:3945 do_sock_getsockopt+0x1fc/0x3c4 net/socket.c:2383 __sys_getsockopt net/socket.c:2412 [inline] __do_sys_getsockopt net/socket.c:2419 [inline] __se_sys_getsockopt net/socket.c:2416 [inline] __arm64_sys_getsockopt+0x168/0x1d8 net/socket.c:2416 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x254 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xe8/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x5c/0x26c arch/arm64/kernel/entry-common.c:724 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:743 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 -> #0 (pcpu_alloc_mutex){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x1774/0x30a4 kernel/locking/lockdep.c:5237 lock_acquire+0x140/0x2e0 kernel/locking/lockdep.c:5868 __mutex_lock_common+0x1d0/0x2678 kernel/locking/mutex.c:614 __mutex_lock kernel/locking/mutex.c:776 [inline] _mutex_lock_killable+0x2c/0x38 kernel/locking/mutex.c:844 pcpu_alloc_noprof+0x20c/0x1940 mm/percpu.c:1782 __percpu_counter_init_many+0x50/0x338 lib/percpu_counter.c:198 blkg_rwstat_init+0x3c/0x144 block/blk-cgroup-rwstat.c:12 throtl_pd_alloc+0xc0/0x3cc block/blk-throttle.c:271 blkcg_activate_policy+0x558/0x994 block/blk-cgroup.c:1632 blk_throtl_init+0x298/0x3a8 block/blk-throttle.c:1330 tg_set_conf+0x21c/0x4a4 block/blk-throttle.c:1359 tg_set_conf_uint+0x38/0x4c block/blk-throttle.c:1398 cgroup_file_write+0x2fc/0x630 kernel/cgroup/cgroup.c:4312 kernfs_fop_write_iter+0x33c/0x4d0 fs/kernfs/file.c:352 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x540/0xa3c fs/read_write.c:686 ksys_write+0x120/0x210 fs/read_write.c:738 __do_sys_write fs/read_write.c:749 [inline] __se_sys_write fs/read_write.c:746 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:746 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x254 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xe8/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x5c/0x26c arch/arm64/kernel/entry-common.c:724 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:743 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 other info that might help us debug this: Chain exists of: pcpu_alloc_mutex --> fs_reclaim --> &q->q_usage_counter(io)#17 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&q->q_usage_counter(io)#17); lock(fs_reclaim); lock(&q->q_usage_counter(io)#17); lock(pcpu_alloc_mutex); *** DEADLOCK *** 7 locks held by syz.2.646/9571: #0: ffff0000e09a29b8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x1fc/0x2a0 fs/file.c:1255 #1: ffff0000c8f36420 (sb_writers#8){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2681 [inline] #1: ffff0000c8f36420 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x24c/0xa3c fs/read_write.c:682 #2: ffff0000cf259888 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x1b4/0x4d0 fs/kernfs/file.c:343 #3: ffff0000d75d2698 (kn->active#61){.+.+}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:80 [inline] #3: ffff0000d75d2698 (kn->active#61){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x1f4/0x4d0 fs/kernfs/file.c:344 #4: ffff0000cc069ee8 (&q->rq_qos_mutex){+.+.}-{4:4}, at: blkg_conf_open_bdev+0x254/0x334 block/blk-cgroup.c:802 #5: ffff0000cc069ce0 (&q->q_usage_counter(io)#17){++++}-{0:0}, at: blk_mq_freeze_queue include/linux/blk-mq.h:954 [inline] #5: ffff0000cc069ce0 (&q->q_usage_counter(io)#17){++++}-{0:0}, at: blk_throtl_init+0x238/0x3a8 block/blk-throttle.c:1323 #6: ffff0000cc069d18 (&q->q_usage_counter(queue)){+.+.}-{0:0}, at: blk_mq_freeze_queue include/linux/blk-mq.h:954 [inline] #6: ffff0000cc069d18 (&q->q_usage_counter(queue)){+.+.}-{0:0}, at: blk_throtl_init+0x238/0x3a8 block/blk-throttle.c:1323 stack backtrace: CPU: 1 UID: 0 PID: 9571 Comm: syz.2.646 Tainted: G L syzkaller #0 PREEMPT Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_circular_bug+0x324/0x32c kernel/locking/lockdep.c:2043 check_noncircular+0x154/0x174 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x1774/0x30a4 kernel/locking/lockdep.c:5237 lock_acquire+0x140/0x2e0 kernel/locking/lockdep.c:5868 __mutex_lock_common+0x1d0/0x2678 kernel/locking/mutex.c:614 __mutex_lock kernel/locking/mutex.c:776 [inline] _mutex_lock_killable+0x2c/0x38 kernel/locking/mutex.c:844 pcpu_alloc_noprof+0x20c/0x1940 mm/percpu.c:1782 __percpu_counter_init_many+0x50/0x338 lib/percpu_counter.c:198 blkg_rwstat_init+0x3c/0x144 block/blk-cgroup-rwstat.c:12 throtl_pd_alloc+0xc0/0x3cc block/blk-throttle.c:271 blkcg_activate_policy+0x558/0x994 block/blk-cgroup.c:1632 blk_throtl_init+0x298/0x3a8 block/blk-throttle.c:1330 tg_set_conf+0x21c/0x4a4 block/blk-throttle.c:1359 tg_set_conf_uint+0x38/0x4c block/blk-throttle.c:1398 cgroup_file_write+0x2fc/0x630 kernel/cgroup/cgroup.c:4312 kernfs_fop_write_iter+0x33c/0x4d0 fs/kernfs/file.c:352 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x540/0xa3c fs/read_write.c:686 ksys_write+0x120/0x210 fs/read_write.c:738 __do_sys_write fs/read_write.c:749 [inline] __se_sys_write fs/read_write.c:746 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:746 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x254 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xe8/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x5c/0x26c arch/arm64/kernel/entry-common.c:724 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:743 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596