syzbot


WARNING: possible circular locking dependency detected (4)

Status: fixed on 2018/07/09 18:05
Subsystems: net
[Documentation on labels]
Fix commit: 05255b823a61 tcp: add TCP_ZEROCOPY_RECEIVE support for zerocopy receive
First crash: 2197d, last: 2189d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: possible circular locking dependency detected (2) 1 2398d 2398d 0/26 closed as invalid on 2017/09/30 06:49
android-414 WARNING: possible circular locking dependency detected C 8 1661d 1841d 0/1 public: reported C repro on 2019/04/10 16:14
upstream WARNING: possible circular locking dependency detected 1 2408d 2408d 0/26 closed as invalid on 2017/09/24 05:49
upstream WARNING: possible circular locking dependency detected (3) 1 2396d 2396d 0/26 closed as invalid on 2017/10/02 13:49

Sample crash report:
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)

======================================================
WARNING: possible circular locking dependency detected
4.17.0-rc2+ #20 Not tainted
------------------------------------------------------
syz-executor244/4536 is trying to acquire lock:
        (ptrval) (&mm->mmap_sem){++++}, at: __might_fault+0xfb/0x1e0 mm/memory.c:4554

but task is already holding lock:
        (ptrval) (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1469 [inline]
        (ptrval) (sk_lock-AF_INET6){+.+.}, at: sock_setsockopt+0x19c/0x1fe0 net/core/sock.c:717

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (sk_lock-AF_INET6){+.+.}:
       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

-> #0 (&mm->mmap_sem){++++}:
       lock_acquire+0x1dc/0x520 kernel/locking/lockdep.c:3920
       __might_fault+0x155/0x1e0 mm/memory.c:4555
       _copy_from_user+0x30/0x150 lib/usercopy.c:10
       copy_from_user include/linux/uaccess.h:147 [inline]
       sock_setsockopt+0xec0/0x1fe0 net/core/sock.c:826
       __sys_setsockopt+0x2df/0x390 net/socket.c:1899
       __do_sys_setsockopt net/socket.c:1914 [inline]
       __se_sys_setsockopt net/socket.c:1911 [inline]
       __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1911
       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(sk_lock-AF_INET6);
                               lock(&mm->mmap_sem);
                               lock(sk_lock-AF_INET6);
  lock(&mm->mmap_sem);

 *** DEADLOCK ***

1 lock held by syz-executor244/4536:
 #0:         (ptrval) (sk_lock-AF_INET6){+.+.}, at: lock_sock include/net/sock.h:1469 [inline]
 #0:         (ptrval) (sk_lock-AF_INET6){+.+.}, at: sock_setsockopt+0x19c/0x1fe0 net/core/sock.c:717

stack backtrace:
CPU: 0 PID: 4536 Comm: syz-executor244 Not tainted 4.17.0-rc2+ #20
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
 __might_fault+0x155/0x1e0 mm/memory.c:4555
 _copy_from_user+0x30/0x150 lib/usercopy.c:10
 copy_from_user include/linux/uaccess.h:147 [inline]
 sock_setsockopt+0xec0/0x1fe0 net/core/sock.c:826
 __sys_setsockopt+0x2df/0x390 net/socket.c:1899
 __do_sys_setsockopt net/socket.c:1914 [inline]
 __se_sys_setsockopt net/socket.c:1911 [inline]
 __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1911
 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x43fd09
RSP: 002b:00007fff6d132958 EFLAGS: 00000217 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fd09
RDX: 000000000000000d RSI: 0000000000000001 RDI: 0000000000000004
RBP: 00000000006ca018 R08: 0000000000000008 R09: 00000000004002c8
R10: 0000000020000940 R11: 0000000000000217 R12: 0000000000401630
R13: 00000000004016

Crashes (27):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/04/26 14:25 net-next-old a9537c937c17 73417389 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/26 05:19 net-next-old c8ad08929d1b 73417389 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/26 03:17 net-next-old c8ad08929d1b 73417389 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/26 01:52 net-next-old c8ad08929d1b 73417389 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/25 22:36 net-next-old c8ad08929d1b 73417389 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/24 16:43 net-next-old 9c20b9372fba 2bf86f40 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/24 01:27 net-next-old a56e6bcd34b5 0d8e591c .config console log report syz C ci-upstream-net-kasan-gce
2018/04/23 08:44 net-next-old 48d7a07ba355 d23fcf6c .config console log report syz C ci-upstream-net-kasan-gce
2018/04/22 18:57 net-next-old e0ada51db907 d23fcf6c .config console log report syz C ci-upstream-net-kasan-gce
2018/04/22 10:58 net-next-old e0ada51db907 d23fcf6c .config console log report syz C ci-upstream-net-kasan-gce
2018/04/22 04:22 net-next-old 0638eb573cde d23fcf6c .config console log report syz C ci-upstream-net-kasan-gce
2018/04/22 03:34 net-next-old 0638eb573cde d23fcf6c .config console log report syz C ci-upstream-net-kasan-gce
2018/04/21 23:44 net-next-old 0638eb573cde d23fcf6c .config console log report syz C ci-upstream-net-kasan-gce
2018/04/21 21:17 net-next-old 0638eb573cde d23fcf6c .config console log report syz C ci-upstream-net-kasan-gce
2018/04/21 05:15 net-next-old cf1a1e07fc8b ca03d688 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/21 00:07 net-next-old 0263ea5cdded cc402841 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/20 02:31 net-next-old bda73d4ec943 eae05cb0 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/20 02:17 net-next-old bda73d4ec943 eae05cb0 .config console log report syz C ci-upstream-net-kasan-gce
2018/04/19 21:36 net-next-old 415787d7799f 3642839c .config console log report syz C ci-upstream-net-kasan-gce
2018/04/27 10:07 upstream 0644f186fc9d 73417389 .config console log report syz ci-upstream-kasan-gce-386
2018/04/27 09:37 upstream 0644f186fc9d 73417389 .config console log report syz ci-upstream-kasan-gce-386
2018/04/27 08:32 upstream 0644f186fc9d 73417389 .config console log report syz ci-upstream-kasan-gce-386
2018/04/27 05:34 upstream 0644f186fc9d 73417389 .config console log report syz ci-upstream-kasan-gce-386
2018/04/26 22:01 upstream 69bfd470f462 73417389 .config console log report syz ci-upstream-kasan-gce-386
2018/04/26 12:10 upstream 26ed24e429d8 73417389 .config console log report syz ci-upstream-kasan-gce-386
2018/04/25 23:08 upstream 3be4aaf4e2d3 73417389 .config console log report syz ci-upstream-kasan-gce-386
2018/04/25 22:35 upstream 3be4aaf4e2d3 73417389 .config console log report syz ci-upstream-kasan-gce-386
* Struck through repros no longer work on HEAD.