syzbot


kernel BUG in btrfs_csum_one_bio

Status: fixed on 2023/07/01 16:05
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+d8941552e21eac774778@syzkaller.appspotmail.com
Fix commit: 806570c0bb7b btrfs: handle memory allocation failure in btrfs_csum_one_bio
First crash: 422d, last: 340d
Cause bisection: introduced by (bisect log) :
commit 2c8f5e8cdf0f77670b1a9f72156ad4e82ed323d1
Author: Filipe Manana <fdmanana@suse.com>
Date: Fri Nov 11 11:50:27 2022 +0000

  btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree

Crash: kernel BUG in btrfs_csum_one_bio (log)
Repro: C syz .config
  
Discussions (6)
Title Replies (including bot) Last reply
[PATCH AUTOSEL 5.4 10/17] btrfs: handle memory allocation failure in btrfs_csum_one_bio 1 (1) 2023/05/31 13:44
[PATCH AUTOSEL 5.10 12/21] btrfs: handle memory allocation failure in btrfs_csum_one_bio 1 (1) 2023/05/31 13:44
[PATCH AUTOSEL 5.15 13/24] btrfs: handle memory allocation failure in btrfs_csum_one_bio 1 (1) 2023/05/31 13:43
[PATCH AUTOSEL 6.1 17/33] btrfs: handle memory allocation failure in btrfs_csum_one_bio 1 (1) 2023/05/31 13:41
[PATCH AUTOSEL 6.3 18/37] btrfs: handle memory allocation failure in btrfs_csum_one_bio 1 (1) 2023/05/31 13:40
[syzbot] [btrfs?] kernel BUG in btrfs_csum_one_bio 1 (2) 2023/01/25 13:11
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/04/13 21:32 1h13m bisect fix upstream job log (0) log
2023/03/14 20:19 50m bisect fix upstream job log (0) log

Sample crash report:
RSP: 002b:00007ffc233556b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f5e11d88ab9
RDX: 000000000000fea7 RSI: 00000000200001c0 RDI: 0000000000000004
RBP: 00007ffc233556e0 R08: 0000000000000002 R09: 00007ffc233556f0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006
R13: 00007ffc23355720 R14: 00007ffc23355700 R15: 000000000000000a
 </TASK>
------------[ cut here ]------------
kernel BUG at fs/btrfs/file-item.c:871!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 5275 Comm: syz-executor267 Not tainted 6.2.0-rc4-syzkaller-00379-gf883675bf652 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
RIP: 0010:btrfs_csum_one_bio+0x11bd/0x1210 fs/btrfs/file-item.c:871
Code: 8b 5c 24 20 e9 85 f2 ff ff e8 0f fa 02 fe 48 c7 c7 e0 88 84 8d 4c 89 f6 48 89 da e8 9d 83 f7 00 e9 4b f0 ff ff e8 f3 f9 02 fe <0f> 0b 44 89 f9 80 e1 07 38 c1 0f 8c 89 fd ff ff be 08 00 00 00 4c
RSP: 0018:ffffc90004a2f120 EFLAGS: 00010293
RAX: ffffffff8388e1fd RBX: 0000000000400140 RCX: ffff88801fd43a80
RDX: 0000000000000000 RSI: 1ffff11003fa8755 RDI: ffff88801fd43aac
RBP: ffffc90004a2f458 R08: ffffffff81c50a8e R09: 00000000ffffffff
R10: fffffbfff1a83333 R11: 1ffffffff1a83332 R12: 1ffff1100fba540c
R13: dffffc0000000000 R14: 000000000000005c R15: 000000000000f000
FS:  0000555556645300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055a1244ffb38 CR3: 0000000021b63000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 btrfs_submit_data_write_bio+0x339/0x4a0 fs/btrfs/inode.c:2755
 submit_one_bio+0x353/0x490 fs/btrfs/extent_io.c:158
 submit_write_bio fs/btrfs/extent_io.c:184 [inline]
 extent_writepages+0x306/0x540 fs/btrfs/extent_io.c:3212
 do_writepages+0x3c3/0x680 mm/page-writeback.c:2581
 filemap_fdatawrite_wbc+0x11e/0x170 mm/filemap.c:388
 __filemap_fdatawrite_range mm/filemap.c:421 [inline]
 filemap_fdatawrite_range+0x175/0x200 mm/filemap.c:439
 btrfs_fdatawrite_range fs/btrfs/file.c:3857 [inline]
 start_ordered_ops fs/btrfs/file.c:1737 [inline]
 btrfs_sync_file+0x383/0x1190 fs/btrfs/file.c:1813
 generic_write_sync include/linux/fs.h:2885 [inline]
 btrfs_do_write_iter+0xcd3/0x1280 fs/btrfs/file.c:1684
 call_write_iter include/linux/fs.h:2189 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x7dc/0xc50 fs/read_write.c:584
 ksys_write+0x177/0x2a0 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f5e11d88ab9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc233556b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f5e11d88ab9
RDX: 000000000000fea7 RSI: 00000000200001c0 RDI: 0000000000000004
RBP: 00007ffc233556e0 R08: 0000000000000002 R09: 00007ffc233556f0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006
R13: 00007ffc23355720 R14: 00007ffc23355700 R15: 000000000000000a
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:btrfs_csum_one_bio+0x11bd/0x1210 fs/btrfs/file-item.c:871
Code: 8b 5c 24 20 e9 85 f2 ff ff e8 0f fa 02 fe 48 c7 c7 e0 88 84 8d 4c 89 f6 48 89 da e8 9d 83 f7 00 e9 4b f0 ff ff e8 f3 f9 02 fe <0f> 0b 44 89 f9 80 e1 07 38 c1 0f 8c 89 fd ff ff be 08 00 00 00 4c
RSP: 0018:ffffc90004a2f120 EFLAGS: 00010293
RAX: ffffffff8388e1fd RBX: 0000000000400140 RCX: ffff88801fd43a80
RDX: 0000000000000000 RSI: 1ffff11003fa8755 RDI: ffff88801fd43aac
RBP: ffffc90004a2f458 R08: ffffffff81c50a8e R09: 00000000ffffffff
R10: fffffbfff1a83333 R11: 1ffffffff1a83332 R12: 1ffff1100fba540c
R13: dffffc0000000000 R14: 000000000000005c R15: 000000000000f000
FS:  0000555556645300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055cbc1e980c8 CR3: 0000000021b63000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/21 23:05 upstream f883675bf652 cc0f9968 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs kernel BUG in btrfs_csum_one_bio
2023/01/21 13:20 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci edb2f0dc90f2 559a440a .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 kernel BUG in btrfs_csum_one_bio
2023/02/12 20:18 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 2d3827b3f393 93e26d60 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 kernel BUG in btrfs_csum_one_bio
2023/01/21 13:01 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci edb2f0dc90f2 559a440a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 kernel BUG in btrfs_csum_one_bio
* Struck through repros no longer work on HEAD.