================================ WARNING: inconsistent lock state syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. kworker/3:0H/36 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff8880720d0260 (sk_lock-AF_X25){+.?.}-{0:0}, at: lock_sock include/net/sock.h:1713 [inline] ffff8880720d0260 (sk_lock-AF_X25){+.?.}-{0:0}, at: x25_kill_by_neigh+0x168/0x280 net/x25/af_x25.c:1778 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 lock_sock_nested+0x41/0xf0 net/core/sock.c:3837 lock_sock include/net/sock.h:1713 [inline] x25_release+0xba/0x440 net/x25/af_x25.c:632 __sock_release+0xb3/0x260 net/socket.c:735 sock_close+0x1c/0x30 net/socket.c:1526 __fput+0x3ff/0xb50 fs/file_table.c:512 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x1d8/0x700 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:343 [inline] __do_fast_syscall_32+0x59f/0x8b0 arch/x86/entry/syscall_32.c:294 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e irq event stamp: 47275750 hardirqs last enabled at (47275750): [] __local_bh_enable_ip+0xa5/0x120 kernel/softirq.c:478 hardirqs last disabled at (47275749): [] __local_bh_enable_ip+0xce/0x120 kernel/softirq.c:455 softirqs last enabled at (47265762): [] __do_softirq kernel/softirq.c:679 [inline] softirqs last enabled at (47265762): [] invoke_softirq kernel/softirq.c:519 [inline] softirqs last enabled at (47265762): [] __irq_exit_rcu+0x16a/0x210 kernel/softirq.c:758 softirqs last disabled at (47275395): [] __do_softirq kernel/softirq.c:679 [inline] softirqs last disabled at (47275395): [] invoke_softirq kernel/softirq.c:519 [inline] softirqs last disabled at (47275395): [] __irq_exit_rcu+0x16a/0x210 kernel/softirq.c:758 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sk_lock-AF_X25); lock(sk_lock-AF_X25); *** DEADLOCK *** locks held by kworker/3:0H/36: 3, last CPU#3: #0: ffff88801c0aa540 ((wq_completion)events_highpri){+.+.}-{0:0}, at: process_one_work+0x1466/0x1b10 kernel/workqueue.c:3371 #1: ffffc900005efd08 ((work_completion)(&vmidi->output_work)){+.+.}-{0:0}, at: process_one_work+0xa2c/0x1b10 kernel/workqueue.c:3372 #2: ffffffff8edec3a0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:309 [inline] #2: ffffffff8edec3a0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #2: ffffffff8edec3a0 (rcu_read_lock){....}-{1:3}, at: netif_receive_skb_core+0x25/0x1a0 net/core/dev.c:6321 stack backtrace: CPU: 3 UID: 0 PID: 36 Comm: kworker/3:0H Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: events_highpri snd_vmidi_output_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_usage_bug.part.0+0x258/0x340 kernel/locking/lockdep.c:4086 print_usage_bug kernel/locking/lockdep.c:4054 [inline] valid_state kernel/locking/lockdep.c:4100 [inline] mark_lock_irq kernel/locking/lockdep.c:4311 [inline] mark_lock+0x956/0x1020 kernel/locking/lockdep.c:4797 mark_usage kernel/locking/lockdep.c:4686 [inline] __lock_acquire+0x7f1/0x1f40 kernel/locking/lockdep.c:5242 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 lock_sock_nested+0x41/0xf0 net/core/sock.c:3837 lock_sock include/net/sock.h:1713 [inline] x25_kill_by_neigh+0x168/0x280 net/x25/af_x25.c:1778 x25_lapb_receive_frame+0x4b1/0x1000 net/x25/x25_dev.c:138 __netif_receive_skb_one_core+0x1b2/0x1e0 net/core/dev.c:6297 netif_receive_skb_core+0x5a/0x1a0 net/core/dev.c:6322 lapbeth_napi_poll+0x42/0xc0 drivers/net/wan/lapbether.c:100 __napi_poll.constprop.0+0xaf/0x450 net/core/dev.c:7830 napi_poll net/core/dev.c:7893 [inline] net_rx_action+0xa40/0xf20 net/core/dev.c:8050 handle_softirqs+0x1e6/0x9d0 kernel/softirq.c:645 __do_softirq kernel/softirq.c:679 [inline] invoke_softirq kernel/softirq.c:519 [inline] __irq_exit_rcu+0x16a/0x210 kernel/softirq.c:758 irq_exit_rcu+0x9/0x30 kernel/softirq.c:775 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:finish_task_switch.isra.0+0x2ca/0x10d0 kernel/sched/core.c:5384 Code: b6 0a 00 00 41 c7 87 20 0e 00 00 00 00 00 00 e9 47 04 00 00 49 8d 7f 48 e8 73 92 fc 09 e8 3e 23 3d 00 fb 48 8d bb 18 17 00 00 <48> b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 04 02 84 RSP: 0018:ffffc900005ef8d8 EFLAGS: 00000206 RAX: 0000000002d15d81 RBX: ffff88801d312580 RCX: 0000000000000040 RDX: 0000000000000001 RSI: ffffffff8e3921ac RDI: ffff88801d313c98 RBP: ffffc900005ef930 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: ffffffff81d6d689 R12: ffff88802948cb00 R13: 0000000000000001 R14: ffffffff9145b9e4 R15: ffff88802b53c040 context_switch kernel/sched/core.c:5536 [inline] __schedule+0x1261/0x6920 kernel/sched/core.c:7284 preempt_schedule_common+0x3c/0xb0 kernel/sched/core.c:7463 preempt_schedule_thunk+0x16/0x40 arch/x86/entry/thunk.S:12 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:211 [inline] _raw_spin_unlock_irqrestore+0x61/0x80 kernel/locking/spinlock.c:221 spin_unlock_irqrestore include/linux/spinlock.h:425 [inline] class_spinlock_irqsave_destructor include/linux/spinlock.h:642 [inline] snd_rawmidi_transmit+0xf1/0x130 sound/core/rawmidi.c:1489 snd_vmidi_output_work+0x111/0x390 sound/core/seq/seq_virmidi.c:152 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 BUG: sleeping function called from invalid context at net/core/sock.c:3839 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 36, name: kworker/3:0H preempt_count: 101, expected: 0 RCU nest depth: 1, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [] preempt_schedule_thunk+0x16/0x40 arch/x86/entry/thunk.S:12 CPU: 3 UID: 0 PID: 36 Comm: kworker/3:0H Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: events_highpri snd_vmidi_output_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 __might_resched.cold+0x1dc/0x222 kernel/sched/core.c:9264 lock_sock_nested+0x52/0xf0 net/core/sock.c:3839 lock_sock include/net/sock.h:1713 [inline] x25_kill_by_neigh+0x168/0x280 net/x25/af_x25.c:1778 x25_lapb_receive_frame+0x4b1/0x1000 net/x25/x25_dev.c:138 __netif_receive_skb_one_core+0x1b2/0x1e0 net/core/dev.c:6297 netif_receive_skb_core+0x5a/0x1a0 net/core/dev.c:6322 lapbeth_napi_poll+0x42/0xc0 drivers/net/wan/lapbether.c:100 __napi_poll.constprop.0+0xaf/0x450 net/core/dev.c:7830 napi_poll net/core/dev.c:7893 [inline] net_rx_action+0xa40/0xf20 net/core/dev.c:8050 handle_softirqs+0x1e6/0x9d0 kernel/softirq.c:645 __do_softirq kernel/softirq.c:679 [inline] invoke_softirq kernel/softirq.c:519 [inline] __irq_exit_rcu+0x16a/0x210 kernel/softirq.c:758 irq_exit_rcu+0x9/0x30 kernel/softirq.c:775 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:finish_task_switch.isra.0+0x2ca/0x10d0 kernel/sched/core.c:5384 Code: b6 0a 00 00 41 c7 87 20 0e 00 00 00 00 00 00 e9 47 04 00 00 49 8d 7f 48 e8 73 92 fc 09 e8 3e 23 3d 00 fb 48 8d bb 18 17 00 00 <48> b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 04 02 84 RSP: 0018:ffffc900005ef8d8 EFLAGS: 00000206 RAX: 0000000002d15d81 RBX: ffff88801d312580 RCX: 0000000000000040 RDX: 0000000000000001 RSI: ffffffff8e3921ac RDI: ffff88801d313c98 RBP: ffffc900005ef930 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: ffffffff81d6d689 R12: ffff88802948cb00 R13: 0000000000000001 R14: ffffffff9145b9e4 R15: ffff88802b53c040 context_switch kernel/sched/core.c:5536 [inline] __schedule+0x1261/0x6920 kernel/sched/core.c:7284 preempt_schedule_common+0x3c/0xb0 kernel/sched/core.c:7463 preempt_schedule_thunk+0x16/0x40 arch/x86/entry/thunk.S:12 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:211 [inline] _raw_spin_unlock_irqrestore+0x61/0x80 kernel/locking/spinlock.c:221 spin_unlock_irqrestore include/linux/spinlock.h:425 [inline] class_spinlock_irqsave_destructor include/linux/spinlock.h:642 [inline] snd_rawmidi_transmit+0xf1/0x130 sound/core/rawmidi.c:1489 snd_vmidi_output_work+0x111/0x390 sound/core/seq/seq_virmidi.c:152 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 ---------------- Code disassembly (best guess): 0: b6 0a mov $0xa,%dh 2: 00 00 add %al,(%rax) 4: 41 c7 87 20 0e 00 00 movl $0x0,0xe20(%r15) b: 00 00 00 00 f: e9 47 04 00 00 jmp 0x45b 14: 49 8d 7f 48 lea 0x48(%r15),%rdi 18: e8 73 92 fc 09 call 0x9fc9290 1d: e8 3e 23 3d 00 call 0x3d2360 22: fb sti 23: 48 8d bb 18 17 00 00 lea 0x1718(%rbx),%rdi * 2a: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax <-- trapping instruction 31: fc ff df 34: 48 89 fa mov %rdi,%rdx 37: 48 c1 ea 03 shr $0x3,%rdx 3b: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax 3f: 84 .byte 0x84