====================================================== WARNING: possible circular locking dependency detected 4.17.0-rc2+ #22 Not tainted netlink: 'syz-executor6': attribute type 21 has an invalid length. ------------------------------------------------------ syz-executor5/9033 is trying to acquire lock: (ptrval) (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1469 [inline] (ptrval) (sk_lock-AF_INET6){+.+.}, at: tcp_mmap+0x1c7/0x14f0 net/ipv4/tcp.c:1759 but task is already holding lock: (ptrval) (&mm->mmap_sem){++++}, at: vm_mmap_pgoff+0x1a1/0x2a0 mm/util.c:355 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&mm->mmap_sem){++++}: __might_fault+0x155/0x1e0 mm/memory.c:4555 _copy_from_iter_full+0x2fd/0xd10 lib/iov_iter.c:607 copy_from_iter_full include/linux/uio.h:124 [inline] sctp_user_addto_chunk+0x70/0x1f0 net/sctp/sm_make_chunk.c:1550 sctp_datamsg_from_user+0x945/0x1540 net/sctp/chunk.c:290 sctp_sendmsg_to_asoc+0xd08/0x2100 net/sctp/socket.c:1951 sctp_sendmsg+0x13a8/0x1d70 net/sctp/socket.c:2123 inet_sendmsg+0x19f/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:639 __sys_sendto+0x3d7/0x670 net/socket.c:1789 __do_sys_sendto net/socket.c:1801 [inline] __se_sys_sendto net/socket.c:1797 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1797 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (sk_lock-AF_INET6){+.+.}: lock_acquire+0x1dc/0x520 kernel/locking/lockdep.c:3920 lock_sock_nested+0xd0/0x120 net/core/sock.c:2844 lock_sock include/net/sock.h:1469 [inline] tcp_mmap+0x1c7/0x14f0 net/ipv4/tcp.c:1759 sock_mmap+0x8e/0xc0 net/socket.c:1144 call_mmap include/linux/fs.h:1789 [inline] mmap_region+0xd13/0x1820 mm/mmap.c:1723 do_mmap+0xc79/0x11d0 mm/mmap.c:1494 do_mmap_pgoff include/linux/mm.h:2237 [inline] vm_mmap_pgoff+0x1fb/0x2a0 mm/util.c:357 ksys_mmap_pgoff+0x4c9/0x640 mm/mmap.c:1544 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline] __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_sem); lock(sk_lock-AF_INET6); lock(&mm->mmap_sem); lock(sk_lock-AF_INET6); *** DEADLOCK *** 1 lock held by syz-executor5/9033: #0: (ptrval) (&mm->mmap_sem){++++}, at: vm_mmap_pgoff+0x1a1/0x2a0 mm/util.c:355 stack backtrace: CPU: 0 PID: 9033 Comm: syz-executor5 Not tainted 4.17.0-rc2+ #22 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+0x1b9/0x294 lib/dump_stack.c:113 print_circular_bug.isra.36.cold.54+0x1bd/0x27d kernel/locking/lockdep.c:1223 check_prev_add kernel/locking/lockdep.c:1863 [inline] check_prevs_add kernel/locking/lockdep.c:1976 [inline] validate_chain kernel/locking/lockdep.c:2417 [inline] __lock_acquire+0x343e/0x5140 kernel/locking/lockdep.c:3431 lock_acquire+0x1dc/0x520 kernel/locking/lockdep.c:3920 lock_sock_nested+0xd0/0x120 net/core/sock.c:2844 lock_sock include/net/sock.h:1469 [inline] tcp_mmap+0x1c7/0x14f0 net/ipv4/tcp.c:1759 sock_mmap+0x8e/0xc0 net/socket.c:1144 call_mmap include/linux/fs.h:1789 [inline] mmap_region+0xd13/0x1820 mm/mmap.c:1723 do_mmap+0xc79/0x11d0 mm/mmap.c:1494 do_mmap_pgoff include/linux/mm.h:2237 [inline] vm_mmap_pgoff+0x1fb/0x2a0 mm/util.c:357 ksys_mmap_pgoff+0x4c9/0x640 mm/mmap.c:1544 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline] __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x455979 RSP: 002b:00007fd86869ac68 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007fd86869b6d4 RCX: 0000000000455979 RDX: 0000000000000000 RSI: 0000000000003000 RDI: 0000000020ffc000 RBP: 000000000072bea0 R08: 0000000000000013 R09: 0000000000000000 R10: 0000000000002811 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000003fe R14: 00000000006f9070 R15: 0000000000000000 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 netlink: 192 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 192 bytes leftover after parsing attributes in process `syz-executor5'. IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 BUG: sleeping function called from invalid context at mm/slab.h:421 in_atomic(): 1, irqs_disabled(): 1, pid: 4482, name: syz-fuzzer INFO: lockdep is turned off. irq event stamp: 129564 hardirqs last enabled at (129563): [] get_user_pages_fast+0x223/0x440 mm/gup.c:1821 hardirqs last disabled at (129564): [] __schedule+0x22d/0x1e30 kernel/sched/core.c:3417 softirqs last enabled at (129442): [] __do_softirq+0x778/0xaf5 kernel/softirq.c:311 softirqs last disabled at (129407): [] invoke_softirq kernel/softirq.c:365 [inline] softirqs last disabled at (129407): [] irq_exit+0x1d1/0x200 kernel/softirq.c:405 CPU: 0 PID: 4482 Comm: syz-fuzzer Not tainted 4.17.0-rc2+ #22 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+0x1b9/0x294 lib/dump_stack.c:113 ___might_sleep.cold.87+0x11f/0x13a kernel/sched/core.c:6188 __might_sleep+0x95/0x190 kernel/sched/core.c:6141 slab_pre_alloc_hook mm/slab.h:421 [inline] slab_alloc mm/slab.c:3378 [inline] __do_kmalloc mm/slab.c:3716 [inline] __kmalloc+0x2b9/0x760 mm/slab.c:3727 kmalloc_array include/linux/slab.h:631 [inline] kcalloc include/linux/slab.h:642 [inline] numa_crng_init drivers/char/random.c:798 [inline] crng_reseed+0x427/0x920 drivers/char/random.c:923 credit_entropy_bits+0x98d/0xa30 drivers/char/random.c:708 add_interrupt_randomness+0x494/0x860 drivers/char/random.c:1254 handle_irq_event_percpu+0xf9/0x1c0 kernel/irq/handle.c:191 handle_irq_event+0xa7/0x135 kernel/irq/handle.c:206 handle_edge_irq+0x20f/0x870 kernel/irq/chip.c:791 generic_handle_irq_desc include/linux/irqdesc.h:159 [inline] handle_irq+0x18c/0x2e7 arch/x86/kernel/irq_64.c:77 do_IRQ+0x78/0x190 arch/x86/kernel/irq.c:245 common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:642 RIP: 0010:on_stack arch/x86/include/asm/stacktrace.h:42 [inline] RIP: 0010:update_stack_state+0x1e7/0x670 arch/x86/kernel/unwind_frame.c:238 RSP: 0018:ffff8801b9d06e78 EFLAGS: 00000a02 ORIG_RAX: ffffffffffffffd5 RAX: 0000000000000001 RBX: ffff8801b9d06fd0 RCX: 1ffff100373a0dfe RDX: ffff8801b9d00000 RSI: ffff8801b9d06fe8 RDI: ffff8801b9d06ff0 RBP: ffff8801b9d06f80 R08: ffffed00373a0e07 R09: ffff8801b9d06fe0 R10: ffffed00373a0e06 R11: ffff8801b9d07037 R12: dffffc0000000000 R13: ffffed00373a0dfd R14: ffff8801b9d06fe0 R15: 0000000000000010 __unwind_start+0xf9/0x330 arch/x86/kernel/unwind_frame.c:404 unwind_start arch/x86/include/asm/unwind.h:54 [inline] __save_stack_trace+0x4a/0xd0 arch/x86/kernel/stacktrace.c:43 save_stack_trace+0x1a/0x20 arch/x86/kernel/stacktrace.c:60 save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 slab_post_alloc_hook mm/slab.h:444 [inline] slab_alloc_node mm/slab.c:3335 [inline] kmem_cache_alloc_node+0x131/0x780 mm/slab.c:3642 __alloc_skb+0x111/0x780 net/core/skbuff.c:193 alloc_skb_fclone include/linux/skbuff.h:1031 [inline] sk_stream_alloc_skb+0x139/0x960 net/ipv4/tcp.c:875 tcp_sendmsg_locked+0xe9f/0x3e10 net/ipv4/tcp.c:1289 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1446 inet_sendmsg+0x19f/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:639 sock_write_iter+0x35a/0x5a0 net/socket.c:908 call_write_iter include/linux/fs.h:1784 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x64d/0x960 fs/read_write.c:487 vfs_write+0x1f8/0x560 fs/read_write.c:549 ksys_write+0xf9/0x250 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x47fc44 RSP: 002b:000000c429b8d840 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000047fc44 RDX: 0000000000000885 RSI: 000000c429292000 RDI: 0000000000000003 RBP: 000000c429b8d890 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000040 R14: 0000000000000011 R15: 000000c4201941b8 random: crng init done IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 bridge: RTM_NEWNEIGH bridge0 without NUD_PERMANENT device lo entered promiscuous mode bridge: RTM_NEWNEIGH bridge0 without NUD_PERMANENT IPVS: ftp: loaded support on port[0] = 21 netlink: 192 bytes leftover after parsing attributes in process `syz-executor7'. bridge: RTM_NEWNEIGH bridge0 without NUD_PERMANENT IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 netlink: 192 bytes leftover after parsing attributes in process `syz-executor7'. bridge: RTM_NEWNEIGH bridge0 without NUD_PERMANENT bridge: RTM_NEWNEIGH bridge0 without NUD_PERMANENT netlink: 'syz-executor1': attribute type 1 has an invalid length. device lo entered promiscuous mode IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 device lo entered promiscuous mode IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 device lo entered promiscuous mode