================================ WARNING: inconsistent lock state syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz.4.345/7216 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff88803780e368 (slock-AF_PHONET/1){+.?.}-{3:3}, at: __sk_receive_skb+0x37d/0xa00 net/core/sock.c:563 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x1b1/0x370 kernel/locking/lockdep.c:5825 _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:382 __sk_receive_skb+0x37d/0xa00 net/core/sock.c:563 sk_receive_skb include/net/sock.h:2022 [inline] pep_do_rcv+0x3eb/0x1e60 net/phonet/pep.c:675 sk_backlog_rcv include/net/sock.h:1190 [inline] __release_sock+0x3a2/0x440 net/core/sock.c:3216 release_sock+0x1e5/0x280 net/core/sock.c:3815 pep_sock_accept+0x33b/0x13e0 net/phonet/pep.c:879 pn_socket_accept+0xd8/0x420 net/phonet/socket.c:309 do_accept+0x340/0x530 net/socket.c:2047 __sys_accept4_file net/socket.c:2081 [inline] __sys_accept4+0x108/0x200 net/socket.c:2103 __do_sys_accept net/socket.c:2116 [inline] __se_sys_accept net/socket.c:2113 [inline] __x64_sys_accept+0x74/0xb0 net/socket.c:2113 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f irq event stamp: 1720 hardirqs last enabled at (1720): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:187 [inline] hardirqs last enabled at (1720): [] _raw_spin_unlock_irq+0x23/0x50 kernel/locking/spinlock.c:206 hardirqs last disabled at (1719): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:140 [inline] hardirqs last disabled at (1719): [] _raw_spin_lock_irq+0x45/0x50 kernel/locking/spinlock.c:174 softirqs last enabled at (1714): [] local_bh_disable include/linux/bottom_half.h:20 [inline] softirqs last enabled at (1714): [] netif_rx+0x65/0xb0 net/core/dev.c:5770 softirqs last disabled at (1715): [] do_softirq kernel/softirq.c:523 [inline] softirqs last disabled at (1715): [] do_softirq+0xac/0xe0 kernel/softirq.c:510 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(slock-AF_PHONET/1); lock(slock-AF_PHONET/1); *** DEADLOCK *** 5 locks held by syz.4.345/7216: #0: ffff88803a190240 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1029 [inline] #0: ffff88803a190240 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: __sock_release+0x86/0x260 net/socket.c:721 #1: ffff88803780ea60 (sk_lock-AF_PHONET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1713 [inline] #1: ffff88803780ea60 (sk_lock-AF_PHONET){+.+.}-{0:0}, at: pep_sock_close+0x92/0x4c0 net/phonet/pep.c:742 #2: ffffffff8e7e5620 (rcu_read_lock){....}-{1:3}, at: local_lock_release include/linux/local_lock_internal.h:62 [inline] #2: ffffffff8e7e5620 (rcu_read_lock){....}-{1:3}, at: process_backlog+0x32a/0x1580 net/core/dev.c:6664 #3: ffff888037809be8 (slock-AF_PHONET){+.-.}-{3:3}, at: spin_lock include/linux/spinlock.h:342 [inline] #3: ffff888037809be8 (slock-AF_PHONET){+.-.}-{3:3}, at: __sk_receive_skb+0x1d3/0xa00 net/core/sock.c:565 #4: ffff888037809c60 (sk_lock-AF_PHONET){+.+.}-{0:0}, at: sk_receive_skb include/net/sock.h:2022 [inline] #4: ffff888037809c60 (sk_lock-AF_PHONET){+.+.}-{0:0}, at: phonet_rcv+0x84c/0x17f0 net/phonet/af_phonet.c:408 stack backtrace: CPU: 1 UID: 0 PID: 7216 Comm: syz.4.345 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 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+0x257/0x340 kernel/locking/lockdep.c:4042 print_usage_bug kernel/locking/lockdep.c:4010 [inline] valid_state kernel/locking/lockdep.c:4056 [inline] mark_lock_irq kernel/locking/lockdep.c:4267 [inline] mark_lock+0x74a/0xa20 kernel/locking/lockdep.c:4753 mark_usage kernel/locking/lockdep.c:4642 [inline] __lock_acquire+0x103a/0x2630 kernel/locking/lockdep.c:5191 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x1b1/0x370 kernel/locking/lockdep.c:5825 _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:382 __sk_receive_skb+0x37d/0xa00 net/core/sock.c:563 sk_receive_skb include/net/sock.h:2022 [inline] pep_do_rcv+0x3eb/0x1e60 net/phonet/pep.c:675 sk_backlog_rcv include/net/sock.h:1190 [inline] __sk_receive_skb+0x905/0xa00 net/core/sock.c:572 sk_receive_skb include/net/sock.h:2022 [inline] phonet_rcv+0x84c/0x17f0 net/phonet/af_phonet.c:408 __netif_receive_skb_one_core+0x1b2/0x1e0 net/core/dev.c:6202 __netif_receive_skb+0x1f/0x120 net/core/dev.c:6315 process_backlog+0x37a/0x1580 net/core/dev.c:6666 __napi_poll.constprop.0+0xaf/0x450 net/core/dev.c:7733 napi_poll net/core/dev.c:7796 [inline] net_rx_action+0xa40/0xf20 net/core/dev.c:7953 handle_softirqs+0x1ea/0xa00 kernel/softirq.c:622 do_softirq kernel/softirq.c:523 [inline] do_softirq+0xac/0xe0 kernel/softirq.c:510 __local_bh_enable_ip+0xf8/0x120 kernel/softirq.c:450 local_bh_enable include/linux/bottom_half.h:33 [inline] netif_rx net/core/dev.c:5775 [inline] netif_rx+0x93/0xb0 net/core/dev.c:5764 pn_send+0x6fa/0x8e0 net/phonet/af_phonet.c:188 pn_skb_send+0x29b/0x650 net/phonet/af_phonet.c:275 pipe_handler_request+0x1af/0x220 net/phonet/pep.c:144 pep_sock_close+0x145/0x4c0 net/phonet/pep.c:748 pn_socket_release+0x82/0xb0 net/phonet/socket.c:34 __sock_release+0xb3/0x260 net/socket.c:722 sock_close+0x1c/0x30 net/socket.c:1514 __fput+0x3ff/0xb50 fs/file_table.c:510 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:67 [inline] exit_to_user_mode_loop+0x107/0x4f0 kernel/entry/common.c:98 __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:318 [inline] do_syscall_64+0x706/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe52419ce59 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:00007ffc46b330b8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007ffc46b331a0 RCX: 00007fe52419ce59 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 000000000001381e R08: 0000000000000001 R09: 0000000000000000 R10: 0000001b31a20000 R11: 0000000000000246 R12: 00007ffc46b331e0 R13: 00007fe524415fac R14: 0000000000013892 R15: 00007fe524415fa0