syzbot


WARNING: still has locks held in tls_rx_reader_lock

Status: upstream: reported C repro on 2022/07/20 17:09
Reported-by: syzbot+16e72110feb2b653ef27@syzkaller.appspotmail.com
Fix commit: dde06aaa89b7 tls: rx: release the sock lock on locking timeout
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 200d, last: 198d

Cause bisection: introduced by (bisect log) :
commit 4cbc325ed6b4dce4910be06d9d6940a8b919c59b
Author: Jakub Kicinski <kuba@kernel.org>
Date: Fri Jul 15 05:22:25 2022 +0000

  tls: rx: allow only one reader at a time

Crash: INFO: task hung in lock_sock_nested (log)
Repro: C syz .config
Last patch testing requests:
Created Duration User Patch Repo Result
2022/07/21 12:33 18m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git e22c88799f26 OK log
2022/07/21 10:49 10m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git e22c88799f26 report log

Sample crash report:
====================================
WARNING: syz-executor279/3626 still has locks held!
5.19.0-rc6-syzkaller-01454-ge22c88799f26 #0 Not tainted
------------------------------------
1 lock held by syz-executor279/3626:
 #0: ffff888026449ab0 (sk_lock-AF_INET6){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1659 [inline]
 #0: ffff888026449ab0 (sk_lock-AF_INET6){+.+.}-{0:0}, at: tls_rx_reader_lock+0x2da/0x4e0 net/tls/tls_sw.c:1817

stack backtrace:
CPU: 0 PID: 3626 Comm: syz-executor279 Not tainted 5.19.0-rc6-syzkaller-01454-ge22c88799f26 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 try_to_freeze include/linux/freezer.h:66 [inline]
 get_signal+0x1424/0x2600 kernel/signal.c:2647
 arch_do_signal_or_restart+0x82/0x2300 arch/x86/kernel/signal.c:869
 exit_to_user_mode_loop kernel/entry/common.c:166 [inline]
 exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201
 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
 syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294
 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f66234ef999
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f66234802f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: fffffffffffffe00 RBX: 00007f66235773f0 RCX: 00007f66234ef999
RDX: 00000000000000c1 RSI: 0000000020000080 RDI: 0000000000000003
RBP: 00007f6623545064 R08: 00007f6623480700 R09: 0000000000000000
R10: 00007f6623480700 R11: 0000000000000246 R12: 0100000000000000
R13: e8fece2d4e6d48fb R14: 0cb28def7c465af4 R15: 00007f66235773f8
 </TASK>

Crashes (4):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-net-kasan-gce 2022/07/19 17:22 net-next e22c88799f26 72a3cc0c .config strace log report syz C WARNING: still has locks held in tls_rx_reader_lock
ci-upstream-net-kasan-gce 2022/07/22 00:37 net-next 5588d6280270 5e6028b9 .config console log report info WARNING: still has locks held in tls_rx_reader_lock
ci-upstream-net-kasan-gce 2022/07/20 05:24 net-next 7f9eee196ec8 775344bc .config console log report info WARNING: still has locks held in tls_rx_reader_lock
ci-upstream-net-kasan-gce 2022/07/19 16:58 net-next e22c88799f26 72a3cc0c .config console log report info WARNING: still has locks held in tls_rx_reader_lock
* Struck through repros no longer work on HEAD.