syzbot


kernel BUG in can_finish_ordered_extent

Status: upstream: reported on 2024/08/25 12:03
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+f88e7f8eca12247510dc@syzkaller.appspotmail.com
First crash: 52d, last: 45d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] kernel BUG in can_finish_ordered_extent 1 (2) 2024/08/26 15:17

Sample crash report:
syz.1.184: attempt to access beyond end of device
loop1: rw=2049, sector=10496, nr_sectors = 96 limit=0
assertion failed: folio->mapping, in fs/btrfs/ordered-data.c:344
------------[ cut here ]------------
kernel BUG at fs/btrfs/ordered-data.c:344!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 UID: 0 PID: 6536 Comm: syz.1.184 Not tainted 6.11.0-rc5-next-20240827-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:can_finish_ordered_extent+0x754/0x9e0 fs/btrfs/ordered-data.c:344
Code: e9 67 fe ff ff e8 5c 94 da fd 48 c7 c7 c0 b6 4c 8c 48 c7 c6 20 bd 4c 8c 48 c7 c2 80 b6 4c 8c b9 58 01 00 00 e8 3d 8f 03 08 90 <0f> 0b e8 35 94 da fd 48 c7 c7 c0 b6 4c 8c 48 c7 c6 40 bd 4c 8c 48
RSP: 0018:ffffc90003d0e910 EFLAGS: 00010046
RAX: 0000000000000040 RBX: dffffc0000000000 RCX: f0a095c18f073300
RDX: ffffc9000a419000 RSI: 00000000000126f5 RDI: 00000000000126f6
RBP: ffffea00015fdb58 R08: ffffffff817453cc R09: 1ffff920007a1cbc
R10: dffffc0000000000 R11: fffff520007a1cbd R12: ffff88805e9fcde8
R13: 0000000000000000 R14: ffff88805e9fcde8 R15: ffffea00015fdb40
FS:  00007f208dda56c0(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000563e1beed008 CR3: 00000000694f6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 btrfs_finish_ordered_extent+0x140/0x480 fs/btrfs/ordered-data.c:410
 end_bbio_data_write+0x4bd/0x750 fs/btrfs/extent_io.c:476
 __btrfs_bio_end_io fs/btrfs/bio.c:116 [inline]
 btrfs_orig_bbio_end_io+0x3ba/0x470 fs/btrfs/bio.c:162
 btrfs_submit_chunk fs/btrfs/bio.c:756 [inline]
 btrfs_submit_bio+0x11fc/0x1940 fs/btrfs/bio.c:775
 submit_one_bio+0x115/0x1c0 fs/btrfs/extent_io.c:120
 submit_extent_folio+0xad3/0xe90
 submit_one_sector fs/btrfs/extent_io.c:1314 [inline]
 __extent_writepage_io+0x84e/0xc90 fs/btrfs/extent_io.c:1390
 __extent_writepage fs/btrfs/extent_io.c:1456 [inline]
 extent_write_cache_pages fs/btrfs/extent_io.c:2122 [inline]
 btrfs_writepages+0x1132/0x22a0 fs/btrfs/extent_io.c:2248
 do_writepages+0x35d/0x870 mm/page-writeback.c:2683
 filemap_fdatawrite_wbc+0x125/0x180 mm/filemap.c:398
 __filemap_fdatawrite_range mm/filemap.c:431 [inline]
 filemap_fdatawrite_range+0x11a/0x180 mm/filemap.c:449
 btrfs_fdatawrite_range fs/btrfs/file.c:3778 [inline]
 start_ordered_ops fs/btrfs/file.c:1546 [inline]
 btrfs_sync_file+0x314/0x10e0 fs/btrfs/file.c:1623
 generic_write_sync include/linux/fs.h:2862 [inline]
 btrfs_do_write_iter+0x5e0/0x760 fs/btrfs/file.c:1498
 do_iter_readv_writev+0x600/0x880
 vfs_writev+0x376/0xba0 fs/read_write.c:971
 do_pwritev fs/read_write.c:1072 [inline]
 __do_sys_pwritev2 fs/read_write.c:1131 [inline]
 __se_sys_pwritev2+0x1ca/0x2d0 fs/read_write.c:1122
 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:0x7f208cf79e79
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:00007f208dda5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007f208d115f80 RCX: 00007f208cf79e79
RDX: 0000000000000001 RSI: 0000000020000100 RDI: 0000000000000006
RBP: 00007f208cfe793e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000005412 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f208d115f80 R15: 00007ffdf2676e38
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:can_finish_ordered_extent+0x754/0x9e0 fs/btrfs/ordered-data.c:344
Code: e9 67 fe ff ff e8 5c 94 da fd 48 c7 c7 c0 b6 4c 8c 48 c7 c6 20 bd 4c 8c 48 c7 c2 80 b6 4c 8c b9 58 01 00 00 e8 3d 8f 03 08 90 <0f> 0b e8 35 94 da fd 48 c7 c7 c0 b6 4c 8c 48 c7 c6 40 bd 4c 8c 48
RSP: 0018:ffffc90003d0e910 EFLAGS: 00010046
RAX: 0000000000000040 RBX: dffffc0000000000 RCX: f0a095c18f073300
RDX: ffffc9000a419000 RSI: 00000000000126f5 RDI: 00000000000126f6
RBP: ffffea00015fdb58 R08: ffffffff817453cc R09: 1ffff920007a1cbc
R10: dffffc0000000000 R11: fffff520007a1cbd R12: ffff88805e9fcde8
R13: 0000000000000000 R14: ffff88805e9fcde8 R15: ffffea00015fdb40
FS:  00007f208dda56c0(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000563e1beed008 CR3: 00000000694f6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/27 21:06 linux-next 6f923748057a 6c853ff9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in can_finish_ordered_extent
2024/08/23 07:31 linux-next c79c85875f1a ce8a9099 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in can_finish_ordered_extent
2024/08/22 09:00 linux-next 6a7917c89f21 ca02180f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in can_finish_ordered_extent
2024/08/22 08:59 linux-next 6a7917c89f21 ca02180f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in can_finish_ordered_extent
2024/08/21 11:58 linux-next eb8c5ca373cb db5852f9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in can_finish_ordered_extent
2024/08/21 11:55 linux-next eb8c5ca373cb db5852f9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in can_finish_ordered_extent
* Struck through repros no longer work on HEAD.