syzbot


INFO: task hung in lock_sock_nested (4)

Status: fixed on 2021/03/10 01:48
Subsystems: mptcp
[Documentation on labels]
Fix commit: 05e3ecea4a63 mptcp: avoid potential infinite loop in mptcp_recvmsg()
First crash: 1462d, last: 1415d
Cause bisection: introduced by (bisect log) :
commit b6df8c81412190fbd5eaa3cec7f642142d9c16cd
Author: Petr Malat <oss@malat.biz>
Date: Fri Oct 30 13:26:33 2020 +0000

  sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms

Crash: BUG: sleeping function called from invalid context in sta_info_move_state (log)
Repro: C syz .config
  
Similar bugs (15)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: task hung in lock_sock_nested (2) net C done 418 1732d 1745d 15/28 fixed on 2020/04/15 17:19
upstream INFO: task hung in lock_sock_nested net C 2593 1749d 2549d 0/28 closed as dup on 2017/12/23 20:15
android-44 INFO: task hung in lock_sock_nested (2) 4 1832d 1927d 0/2 auto-closed as invalid on 2020/03/27 01:37
linux-4.19 INFO: task hung in lock_sock_nested (3) 6 678d 893d 0/1 upstream: reported on 2022/06/23 22:52
upstream INFO: task hung in lock_sock_nested (3) net C done 5 1521d 1522d 15/28 fixed on 2020/11/16 12:12
android-49 INFO: task hung in lock_sock_nested (2) 2 1910d 2029d 0/3 auto-closed as invalid on 2020/01/08 15:18
linux-4.14 INFO: task hung in lock_sock_nested 1 1852d 1852d 0/1 auto-closed as invalid on 2020/03/06 15:38
linux-4.14 INFO: task hung in lock_sock_nested (2) 1 1590d 1590d 0/1 auto-closed as invalid on 2020/11/24 03:07
android-44 INFO: task hung in lock_sock_nested C 82 2469d 2471d 0/2 closed as invalid on 2019/03/08 00:11
upstream INFO: task can't die in __lock_sock bluetooth C done error 1067 391d 1205d 0/28 auto-obsoleted due to no activity on 2024/01/16 13:36
android-49 INFO: task hung in lock_sock_nested C 101 2109d 2471d 0/3 closed as invalid on 2019/03/08 00:11
android-414 INFO: task hung in lock_sock_nested 65 1876d 2061d 0/1 auto-closed as invalid on 2020/02/12 04:11
linux-4.19 INFO: task hung in lock_sock_nested (2) 1 1089d 1089d 0/1 auto-closed as invalid on 2022/04/08 17:15
linux-5.15 INFO: task hung in lock_sock_nested 1 112d 112d 0/3 auto-obsoleted due to no activity on 2024/11/21 04:55
linux-4.19 INFO: task hung in lock_sock_nested 1 1669d 1669d 0/1 auto-closed as invalid on 2020/09/05 19:53

Sample crash report:
INFO: task kworker/0:2:8500 blocked for more than 143 seconds.
      Not tainted 5.10.0-rc5-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:2     state:D stack:26568 pid: 8500 ppid:     2 flags:0x00004000
Workqueue: events mptcp_worker
Call Trace:
 context_switch kernel/sched/core.c:3779 [inline]
 __schedule+0x893/0x2130 kernel/sched/core.c:4528
 schedule+0xcf/0x270 kernel/sched/core.c:4606
 __lock_sock+0x13d/0x260 net/core/sock.c:2499
 lock_sock_nested+0xf1/0x110 net/core/sock.c:3038
 lock_sock include/net/sock.h:1590 [inline]
 mptcp_worker+0xa6/0x17a0 net/mptcp/protocol.c:2221
 process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
 kthread+0x3b1/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

Showing all locks held in the system:
1 lock held by khungtaskd/1651:
 #0: ffffffff8b3378e0 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6254
1 lock held by in:imklog/8181:
 #0: ffff8880140b4370 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe9/0x100 fs/file.c:932
2 locks held by kworker/0:2/8500:
 #0: ffff888010064d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff888010064d38 ((wq_completion)events){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline]
 #0: ffff888010064d38 ((wq_completion)events){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline]
 #0: ffff888010064d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline]
 #0: ffff888010064d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline]
 #0: ffff888010064d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x821/0x15a0 kernel/workqueue.c:2243
 #1: ffffc900011cfda8 ((work_completion)(&msk->work)){+.+.}-{0:0}, at: process_one_work+0x854/0x15a0 kernel/workqueue.c:2247
1 lock held by syz-executor456/8934:

=============================================

NMI backtrace for cpu 0
CPU: 0 PID: 1651 Comm: khungtaskd Not tainted 5.10.0-rc5-syzkaller #0
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+0x107/0x163 lib/dump_stack.c:118
 nmi_cpu_backtrace.cold+0x44/0xd7 lib/nmi_backtrace.c:105
 nmi_trigger_cpumask_backtrace+0x1b3/0x230 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:209 [inline]
 watchdog+0xd43/0xfa0 kernel/hung_task.c:294
 kthread+0x3b1/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 8934 Comm: syz-executor456 Not tainted 5.10.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__lock_is_held kernel/locking/lockdep.c:5185 [inline]
RIP: 0010:lock_is_held_type+0x7e/0x100 kernel/locking/lockdep.c:5476
Code: 85 c0 7f 0f eb 7a 83 c3 01 41 3b 9c 24 10 09 00 00 7d 6d 48 63 c3 48 89 ee 48 8d 04 80 4d 8d 7c c5 00 4c 89 ff e8 62 fc ff ff <85> c0 74 d8 41 83 fe ff 41 bc 01 00 00 00 74 12 41 0f b6 47 22 45
RSP: 0018:ffffc90001d4f430 EFLAGS: 00000046
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 1ffffffff19d9fa3
RDX: 0000000000000000 RSI: ffffffff8b337820 RDI: ffff88801c043d98
RBP: ffffffff8b337820 R08: 0000000000000000 R09: ffffffff8ceccb4f
R10: fffffbfff19d9969 R11: 0000000000000000 R12: ffff88801c043480
R13: ffff88801c043d98 R14: 00000000ffffffff R15: ffff88801c043d98
FS:  00007f059124a700(0000) GS:ffff8880b9f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000006df0c0 CR3: 00000000117dc000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 lock_is_held include/linux/lockdep.h:271 [inline]
 rcu_read_lock_sched_held+0x3a/0x70 kernel/rcu/update.c:123
 trace_lock_acquire include/trace/events/lock.h:13 [inline]
 lock_acquire+0x5c9/0x740 kernel/locking/lockdep.c:5408
 __might_fault mm/memory.c:5033 [inline]
 __might_fault+0x106/0x180 mm/memory.c:5018
 _copy_to_iter+0x3be/0xf80 lib/iov_iter.c:634
 copy_to_iter include/linux/uio.h:137 [inline]
 simple_copy_to_iter+0x4c/0x70 net/core/datagram.c:519
 __skb_datagram_iter+0x4a2/0x760 net/core/datagram.c:448
 skb_copy_datagram_iter+0x40/0x50 net/core/datagram.c:533
 skb_copy_datagram_msg include/linux/skbuff.h:3532 [inline]
 __mptcp_recvmsg_mskq net/mptcp/protocol.c:1713 [inline]
 mptcp_recvmsg+0x571/0x20a0 net/mptcp/protocol.c:1927
 inet6_recvmsg+0x11b/0x5d0 net/ipv6/af_inet6.c:654
 sock_recvmsg_nosec net/socket.c:885 [inline]
 sock_recvmsg net/socket.c:903 [inline]
 sock_recvmsg net/socket.c:899 [inline]
 ____sys_recvmsg+0x2c4/0x600 net/socket.c:2554
 ___sys_recvmsg+0x127/0x200 net/socket.c:2596
 do_recvmmsg+0x24d/0x6c0 net/socket.c:2696
 __sys_recvmmsg net/socket.c:2775 [inline]
 __do_sys_recvmmsg net/socket.c:2798 [inline]
 __se_sys_recvmmsg net/socket.c:2791 [inline]
 __x64_sys_recvmmsg+0x20b/0x260 net/socket.c:2791
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x4499d9
Code: e8 cc 0c 03 00 48 83 c4 18 c3 0f 1f 80 00 00 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 0f 83 5b 04 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f0591249db8 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00000000006dfc28 RCX: 00000000004499d9
RDX: 0000000000000001 RSI: 0000000020005a80 RDI: 0000000000000003
RBP: 00000000006dfc20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dfc2c
R13: 00007ffc9a14b72f R14: 00007f059124a9c0 R15: 00000000006dfc2c

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/01 21:35 net-next-old cb7fb043e69a 07bfe8a5 .config console log report syz C ci-upstream-net-kasan-gce
2021/01/17 18:50 upstream 0da0a8a0a0e1 813be542 .config console log report info ci-upstream-kasan-gce-root INFO: task hung in lock_sock_nested
2020/12/02 03:33 net-next-old 87f75e5860e0 c42a35e9 .config console log report info ci-upstream-net-kasan-gce
2020/12/01 18:46 net-next-old cb7fb043e69a 07bfe8a5 .config console log report info ci-upstream-net-kasan-gce
2020/12/01 14:13 net-next-old cb7fb043e69a 07bfe8a5 .config console log report info ci-upstream-net-kasan-gce
2020/12/01 13:51 net-next-old cb7fb043e69a 07bfe8a5 .config console log report info ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.