syzbot


kernel BUG in btrfs_get_ordered_extents_for_logging

Status: upstream: reported syz repro on 2024/08/29 19:56
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+4704b3cc972bd76024f1@syzkaller.appspotmail.com
Fix commit: cd9253c23aed btrfs: fix race between direct IO write and fsync when using same fd
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-snapshot-upstream-root ci-upstream-bpf-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-usb], missing on: [ci-qemu-native-arm64-kvm ci-qemu2-riscv64 ci-upstream-bpf-next-kasan-gce]
First crash: 20d, last: 19d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] btrfs: Add assert or condition 3 (3) 2024/08/31 12:41
[syzbot] [btrfs?] kernel BUG in btrfs_get_ordered_extents_for_logging 0 (2) 2024/08/30 09:22
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/08/30 09:22 32m lizhi.xu@windriver.com patch upstream OK log

Sample crash report:
------------[ cut here ]------------
kernel BUG at fs/btrfs/ordered-data.c:1018!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 UID: 0 PID: 6479 Comm: syz.4.61 Not tainted 6.11.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:btrfs_get_ordered_extents_for_logging+0x4fd/0x500 fs/btrfs/ordered-data.c:1018
Code: f7 07 90 0f 0b e8 23 f1 df fd 48 c7 c7 40 8a 2c 8c 48 c7 c6 e0 8c 2c 8c 48 c7 c2 20 8a 2c 8c b9 fa 03 00 00 e8 e4 ad f7 07 90 <0f> 0b 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f
RSP: 0018:ffffc90009627938 EFLAGS: 00010246
RAX: 0000000000000055 RBX: 0000000000000000 RCX: 3784e5b0ceb58c00
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffff88806597d690 R08: ffffffff817402ac R09: 1ffff920012c4ec8
R10: dffffc0000000000 R11: fffff520012c4ec9 R12: 0000000000000000
R13: dffffc0000000000 R14: ffffc90009627ae0 R15: ffff88806597d690
FS:  00007f60c8eec6c0(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa599c4220a CR3: 000000007953c000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 btrfs_sync_file+0x929/0x10f0 fs/btrfs/file.c:1712
 generic_write_sync include/linux/fs.h:2821 [inline]
 btrfs_do_write_iter+0x5e2/0x760 fs/btrfs/file.c:1515
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xa72/0xc90 fs/read_write.c:590
 ksys_pwrite64 fs/read_write.c:705 [inline]
 __do_sys_pwrite64 fs/read_write.c:715 [inline]
 __se_sys_pwrite64 fs/read_write.c:712 [inline]
 __x64_sys_pwrite64+0x1aa/0x230 fs/read_write.c:712
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f60c8179e79
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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f60c8eec038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007f60c8316130 RCX: 00007f60c8179e79
RDX: 000000000000003d RSI: 00000000200001c0 RDI: 0000000000000007
RBP: 00007f60c81e793e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007f60c8316130 R15: 00007ffd4fce3d08
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:btrfs_get_ordered_extents_for_logging+0x4fd/0x500 fs/btrfs/ordered-data.c:1018
Code: f7 07 90 0f 0b e8 23 f1 df fd 48 c7 c7 40 8a 2c 8c 48 c7 c6 e0 8c 2c 8c 48 c7 c2 20 8a 2c 8c b9 fa 03 00 00 e8 e4 ad f7 07 90 <0f> 0b 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f
RSP: 0018:ffffc90009627938 EFLAGS: 00010246
RAX: 0000000000000055 RBX: 0000000000000000 RCX: 3784e5b0ceb58c00
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffff88806597d690 R08: ffffffff817402ac R09: 1ffff920012c4ec8
R10: dffffc0000000000 R11: fffff520012c4ec9 R12: 0000000000000000
R13: dffffc0000000000 R14: ffffc90009627ae0 R15: ffff88806597d690
FS:  00007f60c8eec6c0(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f449fcc2723 CR3: 000000007953c000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/26 13:22 upstream 5be63fc19fca d7d32352 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] [mounted in repro #3] [mounted in repro #4] ci2-upstream-fs kernel BUG in btrfs_get_ordered_extents_for_logging
2024/08/26 11:36 upstream 5be63fc19fca d7d32352 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] [mounted in repro #3] [mounted in repro #4] ci2-upstream-fs kernel BUG in btrfs_get_ordered_extents_for_logging
2024/08/25 19:45 upstream 5be63fc19fca d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in btrfs_get_ordered_extents_for_logging
* Struck through repros no longer work on HEAD.