================================ WARNING: inconsistent lock state 6.6.0-rc6-syzkaller-01837-gdf3bc66219e3 #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.3/8520 [HC0[0]:SC1[1]:HE1:SE0] takes: ffffffff8e69d658 (nf_connlabels_lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] ffffffff8e69d658 (nf_connlabels_lock){+.?.}-{2:2}, at: nf_connlabels_put+0x19/0x60 net/netfilter/nf_conntrack_labels.c:78 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] nf_connlabels_get+0x32/0x90 net/netfilter/nf_conntrack_labels.c:66 ovs_ct_init+0x62/0x4c0 net/openvswitch/conntrack.c:1975 ovs_init_net+0x2ff/0x5a0 net/openvswitch/datapath.c:2638 ops_init+0xb9/0x650 net/core/net_namespace.c:136 __register_pernet_operations net/core/net_namespace.c:1165 [inline] register_pernet_operations+0x34b/0x820 net/core/net_namespace.c:1234 register_pernet_device+0x29/0x70 net/core/net_namespace.c:1321 dp_init+0xb7/0x2b0 net/openvswitch/datapath.c:2745 do_one_initcall+0x117/0x630 init/main.c:1232 do_initcall_level init/main.c:1294 [inline] do_initcalls init/main.c:1310 [inline] do_basic_setup init/main.c:1329 [inline] kernel_init_freeable+0x5c2/0x900 init/main.c:1547 kernel_init+0x1c/0x2a0 init/main.c:1437 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 irq event stamp: 97640 hardirqs last enabled at (97640): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (97640): [] _raw_spin_unlock_irqrestore+0x4e/0x70 kernel/locking/spinlock.c:194 hardirqs last disabled at (97639): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (97639): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:162 softirqs last enabled at (96600): [] invoke_softirq kernel/softirq.c:427 [inline] softirqs last enabled at (96600): [] __irq_exit_rcu kernel/softirq.c:632 [inline] softirqs last enabled at (96600): [] irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644 softirqs last disabled at (97555): [] invoke_softirq kernel/softirq.c:427 [inline] softirqs last disabled at (97555): [] __irq_exit_rcu kernel/softirq.c:632 [inline] softirqs last disabled at (97555): [] irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(nf_connlabels_lock); lock(nf_connlabels_lock); *** DEADLOCK *** 7 locks held by syz-executor.3/8520: #0: ffff888025eb0410 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12f/0x250 fs/read_write.c:637 #1: ffff8880200d8c88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x281/0x610 fs/kernfs/file.c:325 #2: ffff88801f5e0578 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a4/0x610 fs/kernfs/file.c:326 #3: ffffffff8dc89ce8 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: new_device_store+0x188/0x6a0 drivers/net/netdevsim/bus.c:160 #4: ffff88801aba50e8 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:992 [inline] #4: ffff88801aba50e8 (&dev->mutex){....}-{3:3}, at: __device_attach+0x7f/0x4b0 drivers/base/dd.c:1005 #5: ffff88801aba6250 (&devlink->lock_key#9){+.+.}-{3:3}, at: nsim_drv_probe+0xd5/0x1490 drivers/net/netdevsim/dev.c:1534 #6: ffffffff8cbab280 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:303 [inline] #6: ffffffff8cbab280 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2134 [inline] #6: ffffffff8cbab280 (rcu_callback){....}-{0:0}, at: rcu_core+0x7c1/0x1bb0 kernel/rcu/tree.c:2403 stack backtrace: CPU: 1 PID: 8520 Comm: syz-executor.3 Not tainted 6.6.0-rc6-syzkaller-01837-gdf3bc66219e3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:3970 [inline] valid_state kernel/locking/lockdep.c:4012 [inline] mark_lock_irq kernel/locking/lockdep.c:4215 [inline] mark_lock+0x11f3/0x1950 kernel/locking/lockdep.c:4677 mark_usage kernel/locking/lockdep.c:4566 [inline] __lock_acquire+0x165c/0x5de0 kernel/locking/lockdep.c:5090 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] nf_connlabels_put+0x19/0x60 net/netfilter/nf_conntrack_labels.c:78 tcf_ct_params_free+0x251/0x460 net/sched/act_ct.c:833 rcu_do_batch kernel/rcu/tree.c:2139 [inline] rcu_core+0x805/0x1bb0 kernel/rcu/tree.c:2403 __do_softirq+0x218/0x965 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1074 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:orc_find arch/x86/kernel/unwind_orc.c:220 [inline] RIP: 0010:unwind_next_frame+0x2f2/0x2390 arch/x86/kernel/unwind_orc.c:494 Code: 76 4c 8d ac 12 f0 66 4e 8f 83 c0 01 49 81 fd 9a 2e 00 90 89 44 24 34 0f 83 0a 0a 00 00 e8 46 8c 4d 00 8b 54 24 34 48 8d 14 52 <48> 8d 94 12 f0 66 4e 8f 48 81 fa 9a 2e 00 90 0f 87 e8 09 00 00 e8 RSP: 0018:ffffc90009e96eb8 EFLAGS: 00000293 RAX: 0000000000000000 RBX: ffffc90009e96f38 RCX: 0000000000000000 RDX: 0000000000442f89 RSI: ffffffff813a591a RDI: ffffffff901cd4a0 RBP: 0000000000000001 R08: 0000000000000004 R09: 0000000000072980 R10: 0000000000098000 R11: 00706f72645f6e6f R12: ffffffff88298055 R13: ffffffff8fd6c5cc R14: 000000000016ba7a R15: ffffc90009e96f6d arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x96/0xd0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x180/0x3f0 mm/slub.c:3523 kmalloc_reserve+0x166/0x260 net/core/skbuff.c:559 pskb_expand_head+0x236/0x1170 net/core/skbuff.c:2097 netlink_trim+0x1eb/0x240 net/netlink/af_netlink.c:1324 netlink_broadcast_filtered+0xca/0xf20 net/netlink/af_netlink.c:1531 netlink_broadcast+0x39/0x50 net/netlink/af_netlink.c:1576 nlmsg_multicast include/net/netlink.h:1090 [inline] genlmsg_multicast_netns include/net/genetlink.h:454 [inline] devlink_trap_notify net/devlink/trap.c:1250 [inline] devlink_trap_notify+0x1a9/0x240 net/devlink/trap.c:1228 devlink_trap_register net/devlink/trap.c:1303 [inline] devl_traps_register.part.0+0x6cf/0xaf0 net/devlink/trap.c:1372 devl_traps_register+0xb9/0xf0 net/devlink/trap.c:1365 nsim_dev_traps_init+0x295/0x5c0 drivers/net/netdevsim/dev.c:903 nsim_drv_probe+0x784/0x1490 drivers/net/netdevsim/dev.c:1574 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x234/0xc90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x117e/0x1aa0 drivers/base/core.c:3624 nsim_bus_dev_new drivers/net/netdevsim/bus.c:290 [inline] new_device_store+0x426/0x6a0 drivers/net/netdevsim/bus.c:167 bus_attr_store+0x76/0xa0 drivers/base/bus.c:170 sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:136 kernfs_fop_write_iter+0x3ff/0x610 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:1956 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f64d387b82f Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 b9 80 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 0c 81 02 00 48 RSP: 002b:00007fff86b3a6e0 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007f64d387b82f RDX: 0000000000000003 RSI: 00007fff86b3a730 RDI: 0000000000000005 RBP: 00007f64d38c8045 R08: 0000000000000000 R09: 00007fff86b3a537 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000003 R13: 00007fff86b3a730 R14: 00007f64d44c4620 R15: 0000000000000003 ---------------- Code disassembly (best guess): 0: 76 4c jbe 0x4e 2: 8d ac 12 f0 66 4e 8f lea -0x70b19910(%rdx,%rdx,1),%ebp 9: 83 c0 01 add $0x1,%eax c: 49 81 fd 9a 2e 00 90 cmp $0xffffffff90002e9a,%r13 13: 89 44 24 34 mov %eax,0x34(%rsp) 17: 0f 83 0a 0a 00 00 jae 0xa27 1d: e8 46 8c 4d 00 call 0x4d8c68 22: 8b 54 24 34 mov 0x34(%rsp),%edx 26: 48 8d 14 52 lea (%rdx,%rdx,2),%rdx * 2a: 48 8d 94 12 f0 66 4e lea -0x70b19910(%rdx,%rdx,1),%rdx <-- trapping instruction 31: 8f 32: 48 81 fa 9a 2e 00 90 cmp $0xffffffff90002e9a,%rdx 39: 0f 87 e8 09 00 00 ja 0xa27 3f: e8 .byte 0xe8