====================================================== WARNING: possible circular locking dependency detected 5.19.0-rc2-syzkaller-00133-g53664d51d351 #0 Not tainted ------------------------------------------------------ syz-executor.5/22624 is trying to acquire lock: ffff8881788110a8 ((&sq->pending_timer)){+.-.}-{0:0}, at: del_timer_sync+0x33/0x1b0 kernel/time/timer.c:1416 but task is already holding lock: ffffffff910d9f70 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] ffffffff910d9f70 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy block/blk-cgroup.c:1515 [inline] ffffffff910d9f70 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x1e7/0x4e0 block/blk-cgroup.c:1497 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&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:349 [inline] blkg_create+0x45e/0x1000 block/blk-cgroup.c:344 blkcg_init_queue+0xb2/0x610 block/blk-cgroup.c:1282 __alloc_disk_node+0x260/0x610 block/genhd.c:1383 __blk_alloc_disk+0x35/0x70 block/genhd.c:1423 brd_alloc.part.0+0x27f/0x7a0 drivers/block/brd.c:391 brd_alloc drivers/block/brd.c:374 [inline] brd_init+0x1b8/0x24b drivers/block/brd.c:477 do_one_initcall+0x103/0x650 init/main.c:1295 do_initcall_level init/main.c:1368 [inline] do_initcalls init/main.c:1384 [inline] do_basic_setup init/main.c:1403 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1610 kernel_init+0x1a/0x1d0 init/main.c:1499 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 -> #1 (&q->queue_lock){..-.}-{2:2}: __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x32/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:374 [inline] throtl_pending_timer_fn+0xf7/0x1690 block/blk-throttle.c:1152 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x679/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x29b/0x9c2 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:649 deref_stack_reg arch/x86/kernel/unwind_orc.c:355 [inline] unwind_next_frame+0x12e4/0x1cc0 arch/x86/kernel/unwind_orc.c:600 arch_stack_walk+0x7d/0xe0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3222 [inline] __kmem_cache_alloc_lru mm/slub.c:3229 [inline] kmem_cache_alloc+0x204/0x3b0 mm/slub.c:3239 kmem_cache_zalloc include/linux/slab.h:723 [inline] __kernfs_new_node+0xd4/0x8b0 fs/kernfs/dir.c:593 kernfs_new_node+0x93/0x120 fs/kernfs/dir.c:655 __kernfs_create_file+0x51/0x350 fs/kernfs/file.c:987 sysfs_add_file_mode_ns+0x20f/0x3f0 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x322/0xb10 fs/sysfs/group.c:148 internal_create_groups.part.0+0x90/0x140 fs/sysfs/group.c:188 internal_create_groups fs/sysfs/group.c:184 [inline] sysfs_create_groups+0x25/0x50 fs/sysfs/group.c:214 device_add_groups drivers/base/core.c:2472 [inline] device_add_attrs drivers/base/core.c:2631 [inline] device_add+0x843/0x1ea0 drivers/base/core.c:3368 netdev_register_kobject+0x181/0x400 net/core/net-sysfs.c:2015 register_netdevice+0xd9d/0x15e0 net/core/dev.c:10047 br_dev_newlink+0x23/0x110 net/bridge/br_netlink.c:1494 rtnl_newlink_create net/core/rtnetlink.c:3363 [inline] __rtnl_newlink+0x1087/0x17e0 net/core/rtnetlink.c:3580 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3593 rtnetlink_rcv_msg+0x43a/0xc90 net/core/rtnetlink.c:6089 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmsg net/socket.c:2575 [inline] __do_sys_sendmsg net/socket.c:2584 [inline] __se_sys_sendmsg net/socket.c:2582 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2582 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 -> #0 ((&sq->pending_timer)){+.-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 del_timer_sync+0x5b/0x1b0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:500 blkcg_deactivate_policy block/blk-cgroup.c:1519 [inline] blkcg_deactivate_policy+0x2d2/0x4e0 block/blk-cgroup.c:1497 blk_throtl_exit+0x8a/0x1a0 block/blk-throttle.c:2336 blkcg_init_queue+0x19b/0x610 block/blk-cgroup.c:1301 __alloc_disk_node+0x260/0x610 block/genhd.c:1383 __blk_mq_alloc_disk+0x133/0x1c0 block/blk-mq.c:3926 nbd_dev_add+0x3b2/0xc20 drivers/block/nbd.c:1780 nbd_genl_connect+0x12d1/0x19e0 drivers/block/nbd.c:1963 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:731 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:792 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmsg net/socket.c:2575 [inline] __do_sys_sendmsg net/socket.c:2584 [inline] __se_sys_sendmsg net/socket.c:2582 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2582 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 other info that might help us debug this: Chain exists of: (&sq->pending_timer) --> &q->queue_lock --> &blkcg->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&blkcg->lock); lock(&q->queue_lock); lock(&blkcg->lock); lock((&sq->pending_timer)); *** DEADLOCK *** 4 locks held by syz-executor.5/22624: #0: ffffffff8d6299b0 (cb_lock){++++}-{3:3}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:802 #1: ffffffff8d629a68 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffffffff8d629a68 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x3e0/0x580 net/netlink/genetlink.c:790 #2: ffff88801da7eb90 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] #2: ffff88801da7eb90 (&q->queue_lock){..-.}-{2:2}, at: blkcg_deactivate_policy block/blk-cgroup.c:1508 [inline] #2: ffff88801da7eb90 (&q->queue_lock){..-.}-{2:2}, at: blkcg_deactivate_policy+0xfe/0x4e0 block/blk-cgroup.c:1497 #3: ffffffff910d9f70 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #3: ffffffff910d9f70 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy block/blk-cgroup.c:1515 [inline] #3: ffffffff910d9f70 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x1e7/0x4e0 block/blk-cgroup.c:1497 stack backtrace: CPU: 0 PID: 22624 Comm: syz-executor.5 Not tainted 5.19.0-rc2-syzkaller-00133-g53664d51d351 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 del_timer_sync+0x5b/0x1b0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:500 blkcg_deactivate_policy block/blk-cgroup.c:1519 [inline] blkcg_deactivate_policy+0x2d2/0x4e0 block/blk-cgroup.c:1497 blk_throtl_exit+0x8a/0x1a0 block/blk-throttle.c:2336 blkcg_init_queue+0x19b/0x610 block/blk-cgroup.c:1301 __alloc_disk_node+0x260/0x610 block/genhd.c:1383 __blk_mq_alloc_disk+0x133/0x1c0 block/blk-mq.c:3926 nbd_dev_add+0x3b2/0xc20 drivers/block/nbd.c:1780 nbd_genl_connect+0x12d1/0x19e0 drivers/block/nbd.c:1963 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:731 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:792 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmsg net/socket.c:2575 [inline] __do_sys_sendmsg net/socket.c:2584 [inline] __se_sys_sendmsg net/socket.c:2582 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2582 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fcea5a89109 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fcea6ba0168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fcea5b9bf60 RCX: 00007fcea5a89109 RDX: 0000000000000000 RSI: 0000000020000380 RDI: 0000000000000008 RBP: 00007fcea6ba01d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffeca21383f R14: 00007fcea6ba0300 R15: 0000000000022000 nbd: failed to add new device