====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.1.155/6494 is trying to acquire lock: ffffffff8ec67520 (pcpu_alloc_mutex){+.+.}-{4:4}, at: pcpu_alloc_noprof+0x231/0x1900 mm/percpu.c:1788 but task is already holding lock: ffff888026cc3bc0 (&q->blkcg_mutex){+.+.}-{4:4}, at: blkg_conf_prep+0xa3/0xd80 block/blk-cgroup.c:849 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&q->blkcg_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821 blkcg_activate_policy+0x1cb/0x8e0 block/blk-cgroup.c:1608 blk_throtl_init+0x2f7/0x420 block/blk-throttle.c:1339 tg_set_conf+0x1db/0x4e0 block/blk-throttle.c:1368 cgroup_file_write+0x331/0x8f0 kernel/cgroup/cgroup.c:4412 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&q->q_usage_counter(io)#17){++++}-{0:0}: blk_alloc_queue+0x544/0x690 block/blk-core.c:504 blk_mq_alloc_queue block/blk-mq.c:4420 [inline] __blk_mq_alloc_disk+0x194/0x390 block/blk-mq.c:4467 loop_add+0x480/0xb40 drivers/block/loop.c:2071 loop_init+0xd7/0x160 drivers/block/loop.c:2310 do_one_initcall+0x250/0x870 init/main.c:1353 do_initcall_level+0x10a/0x1a0 init/main.c:1415 do_initcalls+0x59/0xa0 init/main.c:1431 kernel_init_freeable+0x29d/0x3e0 init/main.c:1666 kernel_init+0x22/0x1d0 init/main.c:1556 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #1 (fs_reclaim){+.+.}-{0:0}: __fs_reclaim_acquire mm/page_alloc.c:4329 [inline] fs_reclaim_acquire+0x71/0x100 mm/page_alloc.c:4343 might_alloc include/linux/sched/mm.h:317 [inline] prepare_alloc_pages+0x15b/0x650 mm/page_alloc.c:5048 __alloc_frozen_pages_noprof+0x12f/0x380 mm/page_alloc.c:5293 __alloc_pages_noprof+0x10/0x100 mm/page_alloc.c:5338 __alloc_pages_node_noprof include/linux/gfp.h:291 [inline] alloc_pages_node_noprof include/linux/gfp.h:318 [inline] pcpu_alloc_pages mm/percpu-vm.c:95 [inline] pcpu_populate_chunk+0x181/0xb30 mm/percpu-vm.c:285 pcpu_alloc_noprof+0xbca/0x1900 mm/percpu.c:1876 xt_percpu_counter_alloc+0x145/0x1e0 net/netfilter/x_tables.c:2129 find_check_entry net/ipv6/netfilter/ip6_tables.c:545 [inline] translate_table+0x1311/0x2040 net/ipv6/netfilter/ip6_tables.c:733 ip6t_register_table+0x112/0x320 net/ipv6/netfilter/ip6_tables.c:1749 ip6table_security_table_init+0x41/0x70 net/ipv6/netfilter/ip6table_security.c:45 xt_find_table_lock+0x311/0x400 net/netfilter/x_tables.c:1353 xt_request_find_table_lock+0x26/0x100 net/netfilter/x_tables.c:1378 get_info net/ipv6/netfilter/ip6_tables.c:977 [inline] do_ip6t_get_ctl+0x77b/0x12f0 net/ipv6/netfilter/ip6_tables.c:1669 nf_getsockopt+0x26e/0x290 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x213/0x2c0 net/ipv6/ipv6_sockglue.c:1464 do_sock_getsockopt+0x51d/0x7e0 net/socket.c:2503 __sys_getsockopt net/socket.c:2534 [inline] __do_sys_getsockopt net/socket.c:2541 [inline] __se_sys_getsockopt net/socket.c:2538 [inline] __x64_sys_getsockopt+0x1a4/0x240 net/socket.c:2538 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (pcpu_alloc_mutex){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3181 [inline] check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x1520/0x2cf0 kernel/locking/lockdep.c:5253 lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5886 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821 pcpu_alloc_noprof+0x231/0x1900 mm/percpu.c:1788 percpu_ref_init+0x42/0x350 lib/percpu-refcount.c:72 blkg_alloc+0xee/0x8f0 block/blk-cgroup.c:316 blkg_conf_prep+0x60b/0xd80 block/blk-cgroup.c:879 tg_set_conf+0x20b/0x4e0 block/blk-throttle.c:1373 cgroup_file_write+0x331/0x8f0 kernel/cgroup/cgroup.c:4412 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: pcpu_alloc_mutex --> &q->q_usage_counter(io)#17 --> &q->blkcg_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&q->blkcg_mutex); lock(&q->q_usage_counter(io)#17); lock(&q->blkcg_mutex); lock(pcpu_alloc_mutex); *** DEADLOCK *** locks held by syz.1.155/6494: 6, last CPU#1: #0: ffff88802ba2a630 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x246/0x320 fs/file.c:1259 #1: ffff888076f3e460 (sb_writers#10){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2754 [inline] #1: ffff888076f3e460 (sb_writers#10){.+.+}-{0:0}, at: vfs_write+0x22b/0xba0 fs/read_write.c:683 #2: ffff888026ee0c80 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x1d8/0x540 fs/kernfs/file.c:336 #3: ffff88805c3aca58 (kn->active#65){.+.+}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline] #3: ffff88805c3aca58 (kn->active#65){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x22b/0x540 fs/kernfs/file.c:337 #4: ffff888026cc3a40 (&q->rq_qos_mutex){+.+.}-{4:4}, at: blkg_conf_open_bdev+0x2a8/0x3c0 block/blk-cgroup.c:806 #5: ffff888026cc3bc0 (&q->blkcg_mutex){+.+.}-{4:4}, at: blkg_conf_prep+0xa3/0xd80 block/blk-cgroup.c:849 stack backtrace: CPU: 1 UID: 0 PID: 6494 Comm: syz.1.155 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2059 check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2191 check_prev_add kernel/locking/lockdep.c:3181 [inline] check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x1520/0x2cf0 kernel/locking/lockdep.c:5253 lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5886 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821 pcpu_alloc_noprof+0x231/0x1900 mm/percpu.c:1788 percpu_ref_init+0x42/0x350 lib/percpu-refcount.c:72 blkg_alloc+0xee/0x8f0 block/blk-cgroup.c:316 blkg_conf_prep+0x60b/0xd80 block/blk-cgroup.c:879 tg_set_conf+0x20b/0x4e0 block/blk-throttle.c:1373 cgroup_file_write+0x331/0x8f0 kernel/cgroup/cgroup.c:4412 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fdcf159e0d9 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:00007fdcf24cd028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fdcf1825fa0 RCX: 00007fdcf159e0d9 RDX: 000000000000006a RSI: 00002000000000c0 RDI: 0000000000000005 RBP: 00007fdcf1635024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdcf1826038 R14: 00007fdcf1825fa0 R15: 00007ffc48b1fa08