syzbot


divide error in dbNextAG

Status: upstream: reported syz repro on 2022/03/19 18:07
Reported-by: syzbot+46f5c25af73eb8330eb6@syzkaller.appspotmail.com
Fix commit: 2cc7cc01c15f jfs: fix divide error in dbNextAG
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-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-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 105d, last: 105d

Cause bisection: failed (bisect log)
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 divide error in dbNextAG 1 308d 308d 0/1 auto-closed as invalid on 2021/12/22 21:17
linux-4.19 divide error in dbNextAG (2) syz error 1 103d 103d 0/1 upstream: reported syz repro on 2022/03/17 14:18
Patch testing requests:
Created Duration User Patch Repo Result
2022/03/19 18:23 8m paskripkin@gmail.com patch upstream OK

Sample crash report:
divide error: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 3622 Comm: syz-executor.0 Not tainted 5.17.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:dbNextAG+0xfc/0x5f0 fs/jfs/jfs_dmap.c:602
Code: 48 89 c1 48 89 44 24 08 83 e0 07 48 c1 e9 03 0f b6 0c 11 48 89 c2 83 c2 03 38 ca 7c 08 84 c9 0f 85 ca 03 00 00 44 89 f8 31 d2 <41> f7 75 14 49 89 c7 49 8d 45 20 48 89 c2 48 89 44 24 20 48 b8 00
RSP: 0018:ffffc900028d7a40 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88801d782800 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88801f5c3008
RBP: ffff88801d782800 R08: 0000000000000000 R09: ffffc900028d797f
R10: fffff5200051af2f R11: 0000000000000000 R12: ffff88806dede530
R13: ffff88801f5c3000 R14: ffff88806dedf598 R15: 0000000000000000
FS:  00007f05def99700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f05def99718 CR3: 000000001ef61000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 diAlloc+0xa96/0x1730 fs/jfs/jfs_imap.c:1342
 ialloc+0x89/0xaa0 fs/jfs/jfs_inode.c:56
 jfs_mkdir+0x1f0/0xab0 fs/jfs/namei.c:225
 vfs_mkdir+0x1c3/0x3b0 fs/namei.c:3933
 do_mkdirat+0x285/0x300 fs/namei.c:3959
 __do_sys_mkdirat fs/namei.c:3974 [inline]
 __se_sys_mkdirat fs/namei.c:3972 [inline]
 __x64_sys_mkdirat+0x115/0x170 fs/namei.c:3972
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f05df845049
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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:00007f05def99168 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f05df958030 RCX: 00007f05df845049
RDX: 0000000000000020 RSI: 0000000020000300 RDI: 0000000000000005
RBP: 00007f05df89f08d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc16fbfa9f R14: 00007f05def99300 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:dbNextAG+0xfc/0x5f0 fs/jfs/jfs_dmap.c:602
Code: 48 89 c1 48 89 44 24 08 83 e0 07 48 c1 e9 03 0f b6 0c 11 48 89 c2 83 c2 03 38 ca 7c 08 84 c9 0f 85 ca 03 00 00 44 89 f8 31 d2 <41> f7 75 14 49 89 c7 49 8d 45 20 48 89 c2 48 89 44 24 20 48 b8 00
RSP: 0018:ffffc900028d7a40 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88801d782800 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88801f5c3008
RBP: ffff88801d782800 R08: 0000000000000000 R09: ffffc900028d797f
R10: fffff5200051af2f R11: 0000000000000000 R12: ffff88806dede530
R13: ffff88801f5c3000 R14: ffff88806dedf598 R15: 0000000000000000
FS:  00007f05def99700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffcf01138f8 CR3: 000000001ef61000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 89 c1             	mov    %rax,%rcx
   3:	48 89 44 24 08       	mov    %rax,0x8(%rsp)
   8:	83 e0 07             	and    $0x7,%eax
   b:	48 c1 e9 03          	shr    $0x3,%rcx
   f:	0f b6 0c 11          	movzbl (%rcx,%rdx,1),%ecx
  13:	48 89 c2             	mov    %rax,%rdx
  16:	83 c2 03             	add    $0x3,%edx
  19:	38 ca                	cmp    %cl,%dl
  1b:	7c 08                	jl     0x25
  1d:	84 c9                	test   %cl,%cl
  1f:	0f 85 ca 03 00 00    	jne    0x3ef
  25:	44 89 f8             	mov    %r15d,%eax
  28:	31 d2                	xor    %edx,%edx
* 2a:	41 f7 75 14          	divl   0x14(%r13) <-- trapping instruction
  2e:	49 89 c7             	mov    %rax,%r15
  31:	49 8d 45 20          	lea    0x20(%r13),%rax
  35:	48 89 c2             	mov    %rax,%rdx
  38:	48 89 44 24 20       	mov    %rax,0x20(%rsp)
  3d:	48                   	rex.W
  3e:	b8                   	.byte 0xb8

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2022/03/15 18:45 upstream 09688c0166e7 9e8eaa75 .config log report syz divide error in dbNextAG
ci-upstream-kasan-gce-selinux-root 2022/03/15 17:59 upstream 09688c0166e7 9e8eaa75 .config log report info divide error in dbNextAG