syzbot


kernel BUG in ext4_ind_remove_space

Status: upstream: reported C repro on 2022/02/14 01:58
Reported-by: syzbot+fcc629d1a1ae8d3fe8a5@syzkaller.appspotmail.com
Fix commit: 2da376228a24 ext4: limit length to bitmap_maxbytes - blocksize in punch_hole
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: 139d, last: 85d

Cause bisection: failed (bisect log)

Fix bisection: fixed by (bisect log) :
commit 2da376228a2427501feb9d15815a45dbdbdd753e
Author: Tadeusz Struk <tadeusz.struk@linaro.org>
Date: Thu Mar 31 20:05:15 2022 +0000

  ext4: limit length to bitmap_maxbytes - blocksize in punch_hole

similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 kernel BUG in ext4_ind_remove_space C 1 18d 139d 0/1 upstream: reported C repro on 2022/02/09 11:57
linux-4.19 kernel BUG in ext4_ind_remove_space C error 1 157d 157d 0/1 upstream: reported C repro on 2022/01/23 01:21
android-5-10 kernel BUG in ext4_ind_remove_space C error 55 48d 159d 2/3 fixed on 2022/05/13 02:56
android-54 kernel BUG in ext4_ind_remove_space C 1 160d 160d 2/2 fixed on 2022/06/08 16:26
Patch testing requests:
Created Duration User Patch Repo Result
2022/03/15 21:39 8m tadeusz.struk@linaro.org patch upstream OK
2022/03/15 20:42 13m tadeusz.struk@linaro.org patch upstream OK
2022/03/15 20:40 13m tadeusz.struk@linaro.org patch https://android.googlesource.com/kernel/common android12-5.10 OK
2022/03/15 19:26 3m tadeusz.struk@linaro.org patch upstream error
2022/03/15 19:21 0m tadeusz.struk@linaro.org patch upstream error

Sample crash report:
EXT4-fs warning (device sda1): ext4_block_to_path:105: block 1074791436 > max in inode 1137
------------[ cut here ]------------
kernel BUG at fs/ext4/indirect.c:1244!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 3590 Comm: syz-executor391 Not tainted 5.17.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:ext4_ind_remove_space+0xfde/0x1400 fs/ext4/indirect.c:1244
Code: 00 0f 85 36 03 00 00 48 8b 0b 4c 89 fe 44 8b 4c 24 20 48 8b 7c 24 10 48 83 c1 04 e8 3c bb ff ff e9 02 f6 ff ff e8 c2 26 66 ff <0f> 0b 4c 8b 7c 24 50 e9 8e f9 ff ff e8 b1 26 66 ff 48 8b 7c 24 10
RSP: 0018:ffffc90001adfab8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
RDX: ffff888021523a00 RSI: ffffffff8212996e RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: ffffffff82128bea R11: 0000000000000000 R12: 0000000000001000
R13: ffffc90001adfb68 R14: ffffc90001adfb88 R15: ffff8880751fa088
FS:  00007f69922ff700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000080 CR3: 0000000021605000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 ext4_punch_hole+0xfe8/0x11d0 fs/ext4/inode.c:4044
 ext4_fallocate+0x1194/0x3ed0 fs/ext4/extents.c:4694
 vfs_fallocate+0x48d/0xe10 fs/open.c:308
 ksys_fallocate fs/open.c:331 [inline]
 __do_sys_fallocate fs/open.c:339 [inline]
 __se_sys_fallocate fs/open.c:337 [inline]
 __x64_sys_fallocate+0xcf/0x140 fs/open.c:337
 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:0x7f699234cdf9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 14 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:00007f69922ff308 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 0000000000000040 RCX: 00007f699234cdf9
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000005
RBP: 00007f69923d5408 R08: 0000000000000000 R09: 0000000000000000
R10: 00000ffeffeff000 R11: 0000000000000246 R12: 00000ffeffeff000
R13: 00007f69923d5400 R14: 00007f69923a3004 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ext4_ind_remove_space+0xfde/0x1400 fs/ext4/indirect.c:1244
Code: 00 0f 85 36 03 00 00 48 8b 0b 4c 89 fe 44 8b 4c 24 20 48 8b 7c 24 10 48 83 c1 04 e8 3c bb ff ff e9 02 f6 ff ff e8 c2 26 66 ff <0f> 0b 4c 8b 7c 24 50 e9 8e f9 ff ff e8 b1 26 66 ff 48 8b 7c 24 10
RSP: 0018:ffffc90001adfab8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
RDX: ffff888021523a00 RSI: ffffffff8212996e RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: ffffffff82128bea R11: 0000000000000000 R12: 0000000000001000
R13: ffffc90001adfb68 R14: ffffc90001adfb88 R15: ffff8880751fa088
FS:  00007f69922ff700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000080 CR3: 0000000021605000 CR4: 0000000000350ef0

Crashes (10):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/03/15 15:13 upstream 09688c0166e7 9e8eaa75 .config log report syz C kernel BUG in ext4_ind_remove_space
ci-upstream-kasan-gce-selinux-root 2022/03/14 03:22 upstream f0e18b03fcaf 9e8eaa75 .config log report syz kernel BUG in ext4_ind_remove_space
ci-upstream-linux-next-kasan-gce-root 2022/02/10 03:12 linux-next ef6b35306dd8 0b33604d .config log report syz kernel BUG in ext4_ind_remove_space
ci-upstream-kasan-gce-root 2022/04/05 05:25 upstream 312310928417 5915c2cb .config log report info kernel BUG in ext4_ind_remove_space
ci-upstream-kasan-gce-selinux-root 2022/03/20 21:59 upstream 14702b3b2438 e2d91b1d .config log report info kernel BUG in ext4_ind_remove_space
ci-upstream-kasan-gce-root 2022/03/15 14:52 upstream 09688c0166e7 9e8eaa75 .config log report info kernel BUG in ext4_ind_remove_space
ci-upstream-kasan-gce-selinux-root 2022/03/14 02:53 upstream f0e18b03fcaf 9e8eaa75 .config log report info kernel BUG in ext4_ind_remove_space
ci-upstream-linux-next-kasan-gce-root 2022/03/27 10:10 linux-next fd4fbb998102 89bc8608 .config log report info kernel BUG in ext4_ind_remove_space
ci-upstream-linux-next-kasan-gce-root 2022/03/18 16:14 linux-next 91265a6da44d e2d91b1d .config log report info kernel BUG in ext4_ind_remove_space
ci-upstream-linux-next-kasan-gce-root 2022/02/10 01:54 linux-next ef6b35306dd8 0b33604d .config log report info kernel BUG in ext4_ind_remove_space