================================ WARNING: inconsistent lock state 4.20.0+ #3 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. syz-executor614/26486 [HC0[0]:SC0[0]:HE1:SE1] takes: 00000000d6da5206 (slock-AF_NETROM){+.?.}, at: spin_lock include/linux/spinlock.h:329 [inline] 00000000d6da5206 (slock-AF_NETROM){+.?.}, at: nr_find_socket+0x117/0x160 net/netrom/af_netrom.c:177 {IN-SOFTIRQ-W} state was registered at: lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3841 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] nr_find_listener net/netrom/af_netrom.c:156 [inline] nr_rx_frame+0x60c/0x1d50 net/netrom/af_netrom.c:955 nr_loopback_timer+0x7b/0x170 net/netrom/nr_loopback.c:62 call_timer_fn+0x254/0x900 kernel/time/timer.c:1325 expire_timers kernel/time/timer.c:1362 [inline] __run_timers+0x6fc/0xd50 kernel/time/timer.c:1681 run_timer_softirq+0x52/0xb0 kernel/time/timer.c:1694 __do_softirq+0x30b/0xb11 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x180/0x1d0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1b7/0x760 arch/x86/kernel/apic/apic.c:1062 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807 arch_local_irq_enable arch/x86/include/asm/paravirt.h:776 [inline] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] _raw_spin_unlock_irq+0x54/0x90 kernel/locking/spinlock.c:192 finish_lock_switch kernel/sched/core.c:2581 [inline] finish_task_switch+0x1e9/0xac0 kernel/sched/core.c:2681 context_switch kernel/sched/core.c:2834 [inline] __schedule+0x89f/0x1e90 kernel/sched/core.c:3472 schedule+0xfe/0x350 kernel/sched/core.c:3516 schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:3574 __mutex_lock_common kernel/locking/mutex.c:1002 [inline] __mutex_lock+0xa3b/0x1670 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 rtnl_lock+0x17/0x20 net/core/rtnetlink.c:77 linkwatch_event+0x5f/0xf0 net/core/link_watch.c:236 process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153 worker_thread+0x143/0x14a0 kernel/workqueue.c:2296 kthread+0x357/0x430 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 irq event stamp: 352 hardirqs last enabled at (349): [] __local_bh_enable_ip+0x15a/0x270 kernel/softirq.c:194 hardirqs last disabled at (351): [] __local_bh_enable_ip+0x11a/0x270 kernel/softirq.c:171 softirqs last enabled at (352): [] spin_unlock_bh include/linux/spinlock.h:374 [inline] softirqs last enabled at (352): [] nr_find_socket+0x12d/0x160 net/netrom/af_netrom.c:183 softirqs last disabled at (350): [] spin_lock_bh include/linux/spinlock.h:334 [inline] softirqs last disabled at (350): [] nr_find_socket+0x24/0x160 net/netrom/af_netrom.c:172 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(slock-AF_NETROM); lock(slock-AF_NETROM); *** DEADLOCK *** 1 lock held by syz-executor614/26486: #0: 00000000d6da5206 (slock-AF_NETROM){+.?.}, at: spin_lock include/linux/spinlock.h:329 [inline] #0: 00000000d6da5206 (slock-AF_NETROM){+.?.}, at: nr_find_socket+0x117/0x160 net/netrom/af_netrom.c:177 stack backtrace: CPU: 1 PID: 26486 Comm: syz-executor614 Not tainted 4.20.0+ #3 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1db/0x2d0 lib/dump_stack.c:113 print_usage_bug.cold+0x330/0x42a kernel/locking/lockdep.c:2475 valid_state kernel/locking/lockdep.c:2488 [inline] mark_lock_irq kernel/locking/lockdep.c:2682 [inline] mark_lock+0x10c4/0x1cd0 kernel/locking/lockdep.c:3062 mark_held_locks+0xb1/0x100 kernel/locking/lockdep.c:2740 __trace_hardirqs_on_caller kernel/locking/lockdep.c:2769 [inline] lockdep_hardirqs_on+0x415/0x5d0 kernel/locking/lockdep.c:2814 trace_hardirqs_on+0xbd/0x310 kernel/trace/trace_preemptirq.c:30 __local_bh_enable_ip+0x15a/0x270 kernel/softirq.c:194 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:176 [inline] _raw_spin_unlock_bh+0x31/0x40 kernel/locking/spinlock.c:200 spin_unlock_bh include/linux/spinlock.h:374 [inline] nr_find_socket+0x12d/0x160 net/netrom/af_netrom.c:183 nr_find_next_circuit+0x71/0x90 net/netrom/af_netrom.c:225 nr_connect+0x6e8/0x1380 net/netrom/af_netrom.c:704 __sys_connect+0x357/0x490 net/socket.c:1664 __do_sys_connect net/socket.c:1675 [inline] __se_sys_connect net/socket.c:1672 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:1672 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x448479 Code: e8 ac e7 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 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 0f 83 1b 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fc624d86d88 EFLAGS: 00000297 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00000000006e39e8 RCX: 0000000000448479 RDX: 0000000000000048 RSI: 0000000020000000 RDI: 0000000000000004 RBP: 00000000006e39e0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000297 R12: 00000000006e39ec R13: 0000000000000003 R14: 00007fc624d876d0 R15: 0000000000000000