syzbot


kernel BUG in ext4_es_cache_extent
Status: upstream: reported C repro on 2022/02/06 13:49
Reported-by: syzbot+c7358a3cd05ee786eb31@syzkaller.appspotmail.com
Fix commit: c878bea3c9d7 ext4: filter out EXT4_FC_REPLAY from on-disk superblock field s_state
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-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-kcsan-gce], missing on: [ci-qemu2-riscv64 ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci2-upstream-usb]
First crash: 114d, last: 7d21h

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: kernel BUG in ext4_es_cache_extent (log)
Repro: C syz .config
Patch testing requests:
Created Duration User Patch Repo Result
2022/02/13 18:03 9m phind.uet@gmail.com patch upstream OK
2022/02/13 15:38 8m phind.uet@gmail.com upstream report log
2022/02/13 11:55 8m phind.uet@gmail.com linux-next error

Sample crash report:
------------[ cut here ]------------
kernel BUG at fs/ext4/extents_status.c:899!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 3591 Comm: syz-executor307 Not tainted 5.17.0-rc8-syzkaller-00077-g14702b3b2438 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:ext4_es_cache_extent+0x4e8/0x550 fs/ext4/extents_status.c:899
Code: 00 48 c7 c7 20 3a c1 89 c6 05 4a 15 70 0b 01 e8 fd 16 f9 06 e9 5a ff ff ff e8 44 db 68 ff 0f 0b e9 d7 fc ff ff e8 38 db 68 ff <0f> 0b e8 31 db 68 ff 0f 0b e9 13 fe ff ff e8 05 c1 af ff e9 c2 fb
RSP: 0018:ffffc90001f46e80 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000000053de RCX: 0000000000000000
RDX: ffff88801ddd42c0 RSI: ffffffff820f1a58 RDI: 0000000000000003
RBP: ffff88806d1dd660 R08: 00000000ffffffff R09: 0000000000000000
R10: ffffffff820f179c R11: 0000000000000000 R12: 0000000000000001
R13: 00000000ffffffff R14: 1ffff920003e8dd1 R15: 00008f1cffffffff
FS:  0000555557469300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffe98856bf8 CR3: 000000001e108000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 ext4_cache_extents+0x13e/0x2d0 fs/ext4/extents.c:518
 ext4_find_extent+0x8f6/0xce0 fs/ext4/extents.c:916
 ext4_ext_map_blocks+0x1e2/0x5f60 fs/ext4/extents.c:4098
 ext4_map_blocks+0x9ca/0x18a0 fs/ext4/inode.c:563
 ext4_getblk+0x553/0x6b0 fs/ext4/inode.c:849
 ext4_bread_batch+0x7c/0x550 fs/ext4/inode.c:923
 __ext4_find_entry+0x482/0x1050 fs/ext4/namei.c:1600
 ext4_lookup_entry fs/ext4/namei.c:1701 [inline]
 ext4_lookup fs/ext4/namei.c:1769 [inline]
 ext4_lookup+0x4fc/0x730 fs/ext4/namei.c:1760
 __lookup_slow+0x24c/0x480 fs/namei.c:1707
 lookup_slow fs/namei.c:1724 [inline]
 walk_component+0x40f/0x6a0 fs/namei.c:2020
 link_path_walk.part.0+0x7ef/0xf70 fs/namei.c:2347
 link_path_walk fs/namei.c:2272 [inline]
 path_openat+0x266/0x2940 fs/namei.c:3605
 do_filp_open+0x1aa/0x400 fs/namei.c:3636
 do_sys_openat2+0x16d/0x4d0 fs/open.c:1214
 do_sys_open fs/open.c:1230 [inline]
 __do_sys_openat fs/open.c:1246 [inline]
 __se_sys_openat fs/open.c:1241 [inline]
 __x64_sys_openat+0x13f/0x1f0 fs/open.c:1241
 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:0x7f7262acdf19
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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc78095188 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7262acdf19
RDX: 000000000000c880 RSI: 0000000020000100 RDI: 0000000000000005
RBP: 00007f7262a8d7b0 R08: 0000000800000015 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7262a8d840
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ext4_es_cache_extent+0x4e8/0x550 fs/ext4/extents_status.c:899
Code: 00 48 c7 c7 20 3a c1 89 c6 05 4a 15 70 0b 01 e8 fd 16 f9 06 e9 5a ff ff ff e8 44 db 68 ff 0f 0b e9 d7 fc ff ff e8 38 db 68 ff <0f> 0b e8 31 db 68 ff 0f 0b e9 13 fe ff ff e8 05 c1 af ff e9 c2 fb
RSP: 0018:ffffc90001f46e80 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000000053de RCX: 0000000000000000
RDX: ffff88801ddd42c0 RSI: ffffffff820f1a58 RDI: 0000000000000003
RBP: ffff88806d1dd660 R08: 00000000ffffffff R09: 0000000000000000
R10: ffffffff820f179c R11: 0000000000000000 R12: 0000000000000001
R13: 00000000ffffffff R14: 1ffff920003e8dd1 R15: 00008f1cffffffff
FS:  0000555557469300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffe98856bf8 CR3: 000000001e108000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Fix bisection attempts:
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2022/05/19 20:50 upstream b015dcd62b86 e2d91b1d .config log report syz C
ci-upstream-kasan-gce-selinux-root 2022/04/19 20:30 upstream 559089e0a93d e2d91b1d .config log report syz C
ci-upstream-kasan-gce-smack-root 2022/03/19 11:00 upstream 34e047aa16c0 2bea8a27 .config log report syz C
Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2022/03/20 18:18 upstream 14702b3b2438 e2d91b1d .config log report syz C kernel BUG in ext4_es_cache_extent
ci-upstream-kasan-gce-smack-root 2022/02/17 10:42 upstream 359303076163 2bea8a27 .config log report syz C kernel BUG in ext4_es_cache_extent
ci-upstream-kasan-gce-root 2022/02/02 13:45 upstream 9f7fb8de5d9b 4ebb2798 .config log report syz C kernel BUG in ext4_es_cache_extent