BUG: sleeping function called from invalid context at lib/iov_iter.c:619 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4136, name: syz-executor.3 2 locks held by syz-executor.3/4136: #0: ffff888078f28d00 (&u->iolock){+.+.}-{3:3}, at: unix_stream_read_generic+0x16c6/0x2190 net/unix/af_unix.c:2501 #1: ffff888078f28df0 (&u->lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:359 [inline] #1: ffff888078f28df0 (&u->lock){+.+.}-{2:2}, at: unix_stream_read_generic+0x16d0/0x2190 net/unix/af_unix.c:2502 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 4136 Comm: syz-executor.3 Not tainted 5.14.0-rc4-next-20210806-syzkaller #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:105 ___might_sleep.cold+0x1f3/0x239 kernel/sched/core.c:9182 __might_fault+0x6e/0x180 mm/memory.c:5260 _copy_to_iter+0x199/0x1600 lib/iov_iter.c:619 copy_to_iter include/linux/uio.h:139 [inline] simple_copy_to_iter+0x4c/0x70 net/core/datagram.c:519 __skb_datagram_iter+0x10f/0x770 net/core/datagram.c:425 skb_copy_datagram_iter+0x40/0x50 net/core/datagram.c:533 skb_copy_datagram_msg include/linux/skbuff.h:3620 [inline] unix_stream_read_actor+0x78/0xc0 net/unix/af_unix.c:2701 unix_stream_recv_urg net/unix/af_unix.c:2433 [inline] unix_stream_read_generic+0x17cd/0x2190 net/unix/af_unix.c:2504 unix_stream_recvmsg+0xb1/0xf0 net/unix/af_unix.c:2717 sock_recvmsg_nosec net/socket.c:944 [inline] sock_recvmsg net/socket.c:962 [inline] sock_recvmsg net/socket.c:958 [inline] __sys_recvfrom+0x248/0x3a0 net/socket.c:2087 __do_sys_recvfrom net/socket.c:2105 [inline] __se_sys_recvfrom net/socket.c:2101 [inline] __x64_sys_recvfrom+0xdd/0x1b0 net/socket.c:2101 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+0x44/0xae RIP: 0033:0x4665e9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc2f6c0b188 EFLAGS: 00000246 ORIG_RAX: 000000000000002d RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 00000000000000dc RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00000000004bfcc4 R08: 00000000200001c0 R09: 0000000000000080 R10: 0000000000002021 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007fffb68c1e2f R14: 00007fc2f6c0b300 R15: 0000000000022000 ============================= [ BUG: Invalid wait context ] 5.14.0-rc4-next-20210806-syzkaller #0 Tainted: G W ----------------------------- syz-executor.3/4136 is trying to lock: ffff8880aaa79628 (&mm->mmap_lock#2){++++}-{3:3}, at: __might_fault+0xa3/0x180 mm/memory.c:5262 other info that might help us debug this: context-{4:4} 2 locks held by syz-executor.3/4136: #0: ffff888078f28d00 (&u->iolock){+.+.}-{3:3}, at: unix_stream_read_generic+0x16c6/0x2190 net/unix/af_unix.c:2501 #1: ffff888078f28df0 (&u->lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:359 [inline] #1: ffff888078f28df0 (&u->lock){+.+.}-{2:2}, at: unix_stream_read_generic+0x16d0/0x2190 net/unix/af_unix.c:2502 stack backtrace: CPU: 1 PID: 4136 Comm: syz-executor.3 Tainted: G W 5.14.0-rc4-next-20210806-syzkaller #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:105 print_lock_invalid_wait_context kernel/locking/lockdep.c:4666 [inline] check_wait_context kernel/locking/lockdep.c:4727 [inline] __lock_acquire.cold+0x213/0x3ab kernel/locking/lockdep.c:4965 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __might_fault mm/memory.c:5263 [inline] __might_fault+0x106/0x180 mm/memory.c:5248 _copy_to_iter+0x199/0x1600 lib/iov_iter.c:619 copy_to_iter include/linux/uio.h:139 [inline] simple_copy_to_iter+0x4c/0x70 net/core/datagram.c:519 __skb_datagram_iter+0x10f/0x770 net/core/datagram.c:425 skb_copy_datagram_iter+0x40/0x50 net/core/datagram.c:533 skb_copy_datagram_msg include/linux/skbuff.h:3620 [inline] unix_stream_read_actor+0x78/0xc0 net/unix/af_unix.c:2701 unix_stream_recv_urg net/unix/af_unix.c:2433 [inline] unix_stream_read_generic+0x17cd/0x2190 net/unix/af_unix.c:2504 unix_stream_recvmsg+0xb1/0xf0 net/unix/af_unix.c:2717 sock_recvmsg_nosec net/socket.c:944 [inline] sock_recvmsg net/socket.c:962 [inline] sock_recvmsg net/socket.c:958 [inline] __sys_recvfrom+0x248/0x3a0 net/socket.c:2087 __do_sys_recvfrom net/socket.c:2105 [inline] __se_sys_recvfrom net/socket.c:2101 [inline] __x64_sys_recvfrom+0xdd/0x1b0 net/socket.c:2101 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+0x44/0xae RIP: 0033:0x4665e9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc2f6c0b188 EFLAGS: 00000246 ORIG_RAX: 000000000000002d RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 00000000000000dc RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00000000004bfcc4 R08: 00000000200001c0 R09: 0000000000000080 R10: 0000000000002021 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007fffb68c1e2f R14: 00007fc2f6c0b300 R15: 0000000000022000