syzbot


kernel BUG in __clear_extent_bit

Status: fixed on 2023/02/24 13:51
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+5338ef8374ed180ba281@syzkaller.appspotmail.com
Fix commit: 5a75034e71ef btrfs: do not panic if we can't allocate a prealloc extent state
First crash: 516d, last: 501d
Cause bisection: failed (error log, bisect log)
  
Discussions (2)
Title Replies (including bot) Last reply
Re: [syzbot] kernel BUG in __clear_extent_bit 1 (1) 2022/12/02 10:42
[syzbot] kernel BUG in __clear_extent_bit 0 (1) 2022/11/25 13:58
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 kernel BUG in __clear_extent_bit origin:upstream missing-backport C error 2 212d 258d 0/3 upstream: reported C repro on 2023/08/11 00:58

Sample crash report:
RSP: 002b:00007ffe31004eb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffe31004f28 RCX: 00007f72f6eea6c9
RDX: 0000000000000004 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007ffe31004ec0 R08: 0000000000000002 R09: 0000000000003032
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007ffe31005000 R14: 431bde82d7b634db R15: 00007ffe31004f00
 </TASK>
------------[ cut here ]------------
kernel BUG at fs/btrfs/extent-io-tree.c:639!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 3629 Comm: syz-executor387 Not tainted 6.1.0-rc8-syzkaller-00152-g3ecc37918c80 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:__clear_extent_bit+0x722/0xca0 fs/btrfs/extent-io-tree.c:639
Code: fa ff ff e9 70 fb ff ff e8 2b 93 fb fd bf 20 0a 00 00 e8 31 ca ff ff 48 85 c0 48 89 44 24 18 0f 85 40 fc ff ff e8 0e 93 fb fd <0f> 0b e8 07 93 fb fd 48 89 ef e8 2f d0 ff ff e9 3a fb ff ff e8 f5
RSP: 0018:ffffc90003bdf8b8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: ffff88801e470000 RSI: ffffffff83848af2 RDI: 0000000000000000
RBP: ffff88801f426a80 R08: 00000000ffffffff R09: ffffffff8c6f8c73
R10: fffffbfff18df18e R11: 0000000000000000 R12: 0000000000002000
R13: 000000000004ffff R14: 0000000000000000 R15: 0000000000002fff
FS:  0000555556fb33c0(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005575fe304940 CR3: 000000007bef5000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 try_release_extent_state fs/btrfs/extent_io.c:3391 [inline]
 try_release_extent_mapping+0x539/0x690 fs/btrfs/extent_io.c:3487
 __btrfs_release_folio fs/btrfs/inode.c:8175 [inline]
 btrfs_release_folio+0xc8/0x130 fs/btrfs/inode.c:8188
 filemap_release_folio+0x13f/0x1b0 mm/filemap.c:3948
 mapping_evict_folio+0x1fe/0x280 mm/truncate.c:279
 invalidate_mapping_pagevec+0x19f/0x490 mm/truncate.c:528
 btrfs_direct_write fs/btrfs/file.c:1917 [inline]
 btrfs_do_write_iter+0xfdc/0x1450 fs/btrfs/file.c:1980
 call_write_iter include/linux/fs.h:2199 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x9ed/0xdd0 fs/read_write.c:584
 ksys_write+0x12b/0x250 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f72f6eea6c9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 17 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:00007ffe31004eb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffe31004f28 RCX: 00007f72f6eea6c9
RDX: 0000000000000004 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007ffe31004ec0 R08: 0000000000000002 R09: 0000000000003032
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007ffe31005000 R14: 431bde82d7b634db R15: 00007ffe31004f00
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__clear_extent_bit+0x722/0xca0 fs/btrfs/extent-io-tree.c:639
Code: fa ff ff e9 70 fb ff ff e8 2b 93 fb fd bf 20 0a 00 00 e8 31 ca ff ff 48 85 c0 48 89 44 24 18 0f 85 40 fc ff ff e8 0e 93 fb fd <0f> 0b e8 07 93 fb fd 48 89 ef e8 2f d0 ff ff e9 3a fb ff ff e8 f5
RSP: 0018:ffffc90003bdf8b8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: ffff88801e470000 RSI: ffffffff83848af2 RDI: 0000000000000000
RBP: ffff88801f426a80 R08: 00000000ffffffff R09: ffffffff8c6f8c73
R10: fffffbfff18df18e R11: 0000000000000000 R12: 0000000000002000
R13: 000000000004ffff R14: 0000000000000000 R15: 0000000000002fff
FS:  0000555556fb33c0(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005575fe304940 CR3: 000000007bef5000 CR4: 0000000000350ef0

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/12/10 17:40 upstream 3ecc37918c80 67be1ae7 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root kernel BUG in __clear_extent_bit
2022/12/10 02:57 upstream 0d1409e4ff08 67be1ae7 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs kernel BUG in __clear_extent_bit
2022/11/25 13:45 upstream c3eb11fbb826 74a66371 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs kernel BUG in __clear_extent_bit
2022/11/26 03:04 upstream 08ad43d554ba f4470a7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in __clear_extent_bit
2022/11/25 13:28 upstream c3eb11fbb826 74a66371 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in __clear_extent_bit
* Struck through repros no longer work on HEAD.