syzbot


divide error in tcp_rcv_space_adjust (3)

Status: internal: reported C repro on 2024/04/30 11:12
Subsystems: net
[Documentation on labels]
Fix commit: 94062790aedb UPSTREAM: tcp: defer shutdown(SEND_SHUTDOWN) for TCP_SYN_RECV sockets
Patched on: [ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root 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-386-root ci-upstream-kmsan-gce-root 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-net-next-test-gce ci2-upstream-usb], missing on: []
First crash: 52d, last: 51d
Cause bisection: introduced by (bisect log) :
commit 961d0e5b32946703125964f9f5b6321d60f4d706
Author: Zh-yuan Ye <ye.zh-yuan@socionext.com>
Date: Tue Mar 24 08:28:25 2020 +0000

  net: cbs: Fix software cbs to consider packet sending time

Crash: divide error in tcp_rcv_space_adjust (log)
Repro: C syz .config
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream divide error in tcp_rcv_space_adjust (2) net 1 447d 447d 22/27 fixed on 2023/07/01 16:05
upstream divide error in tcp_rcv_space_adjust net 3 752d 783d 0/27 auto-closed as invalid on 2022/08/30 02:07
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/05/01 04:05 39m edumazet@google.com patch upstream OK log

Sample crash report:
divide error: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 PID: 5083 Comm: syz-executor367 Not tainted 6.9.0-rc6-syzkaller-00046-g18daea77cca6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:tcp_rcv_space_adjust+0x2df/0x890 net/ipv4/tcp_input.c:767
Code: e3 04 4c 01 eb 48 8b 44 24 38 0f b6 04 10 84 c0 49 89 d5 0f 85 a5 03 00 00 41 8b 8e c8 09 00 00 89 e8 29 c8 48 0f af c3 31 d2 <48> f7 f1 48 8d 1c 43 49 8d 96 76 08 00 00 48 89 d0 48 c1 e8 03 48
RSP: 0018:ffffc9000268f3f0 EFLAGS: 00010246
RAX: 846f1f571fd61f12 RBX: 00000001046d73a6 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00000000822ebbb3 R08: ffffffff89e535a4 R09: 1ffffffff25e6ab7
R10: dffffc0000000000 R11: ffffffff8135e920 R12: ffff88802af40d30
R13: dffffc0000000000 R14: ffff88802af40d00 R15: 1ffff110055e82da
FS:  0000555571c8f380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff04b5b4308 CR3: 000000007ae4e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 tcp_recvmsg_locked+0x106d/0x25a0 net/ipv4/tcp.c:2513
 tcp_recvmsg+0x25d/0x920 net/ipv4/tcp.c:2578
 inet6_recvmsg+0x16a/0x730 net/ipv6/af_inet6.c:680
 sock_recvmsg_nosec net/socket.c:1046 [inline]
 sock_recvmsg+0x109/0x280 net/socket.c:1068
 ____sys_recvmsg+0x1db/0x470 net/socket.c:2803
 ___sys_recvmsg net/socket.c:2845 [inline]
 do_recvmmsg+0x474/0xae0 net/socket.c:2939
 __sys_recvmmsg net/socket.c:3018 [inline]
 __do_sys_recvmmsg net/socket.c:3041 [inline]
 __se_sys_recvmmsg net/socket.c:3034 [inline]
 __x64_sys_recvmmsg+0x199/0x250 net/socket.c:3034
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1e2d31c769
Code: 48 83 c4 28 c3 e8 37 17 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffb6628df8 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007fffb6628fd8 RCX: 00007f1e2d31c769
RDX: 0000000000000001 RSI: 0000000020000bc0 RDI: 0000000000000005
RBP: 00007f1e2d38f610 R08: 0000000000000000 R09: 000000000000001c
R10: 0000000000000122 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fffb6628fc8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:tcp_rcv_space_adjust+0x2df/0x890 net/ipv4/tcp_input.c:767
Code: e3 04 4c 01 eb 48 8b 44 24 38 0f b6 04 10 84 c0 49 89 d5 0f 85 a5 03 00 00 41 8b 8e c8 09 00 00 89 e8 29 c8 48 0f af c3 31 d2 <48> f7 f1 48 8d 1c 43 49 8d 96 76 08 00 00 48 89 d0 48 c1 e8 03 48
RSP: 0018:ffffc9000268f3f0 EFLAGS: 00010246
RAX: 846f1f571fd61f12 RBX: 00000001046d73a6 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00000000822ebbb3 R08: ffffffff89e535a4 R09: 1ffffffff25e6ab7
R10: dffffc0000000000 R11: ffffffff8135e920 R12: ffff88802af40d30
R13: dffffc0000000000 R14: ffff88802af40d00 R15: 1ffff110055e82da
FS:  0000555571c8f380(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020008000 CR3: 000000007ae4e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	e3 04                	jrcxz  0x6
   2:	4c 01 eb             	add    %r13,%rbx
   5:	48 8b 44 24 38       	mov    0x38(%rsp),%rax
   a:	0f b6 04 10          	movzbl (%rax,%rdx,1),%eax
   e:	84 c0                	test   %al,%al
  10:	49 89 d5             	mov    %rdx,%r13
  13:	0f 85 a5 03 00 00    	jne    0x3be
  19:	41 8b 8e c8 09 00 00 	mov    0x9c8(%r14),%ecx
  20:	89 e8                	mov    %ebp,%eax
  22:	29 c8                	sub    %ecx,%eax
  24:	48 0f af c3          	imul   %rbx,%rax
  28:	31 d2                	xor    %edx,%edx
* 2a:	48 f7 f1             	div    %rcx <-- trapping instruction
  2d:	48 8d 1c 43          	lea    (%rbx,%rax,2),%rbx
  31:	49 8d 96 76 08 00 00 	lea    0x876(%r14),%rdx
  38:	48 89 d0             	mov    %rdx,%rax
  3b:	48 c1 e8 03          	shr    $0x3,%rax
  3f:	48                   	rex.W

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/01 13:45 upstream 18daea77cca6 3ba885bc .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce divide error in tcp_rcv_space_adjust
2024/05/01 01:39 upstream 98369dccd2f8 9e0e6af1 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root divide error in tcp_rcv_space_adjust
2024/04/30 11:11 upstream 98369dccd2f8 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root divide error in tcp_rcv_space_adjust
* Struck through repros no longer work on HEAD.