syzbot


kernel BUG in insert_state_fast

Status: upstream: reported C repro on 2022/11/29 21:10
Reported-by: syzbot+9ce4a36127ca92b59677@syzkaller.appspotmail.com
First crash: 72d, last: 8d07h

Cause bisection: introduced by (bisect log) :
commit 05fd9564e9faf0f23b4676385e27d9405cef6637
Author: Darrick J. Wong <djwong@kernel.org>
Date: Mon Mar 14 17:55:32 2022 +0000

  btrfs: fix fallocate to use file_modified to update permissions consistently

Crash: kernel BUG in set_state_bits (log)
Repro: C syz .config

Sample crash report:
RDX: 00000000000ffe00 RSI: 0000000020004200 RDI: 0000000000000005
RBP: 00007ffc02595290 R08: 0000000000000001 R09: 00007f8ec4aa0035
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
------------[ cut here ]------------
kernel BUG at fs/btrfs/extent-io-tree.c:379!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5066 Comm: syz-executor203 Not tainted 6.2.0-rc3-syzkaller-00008-g1fe4fd6f5cad #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:set_state_bits fs/btrfs/extent-io-tree.c:379 [inline]
RIP: 0010:insert_state_fast+0x242/0x250 fs/btrfs/extent-io-tree.c:437
Code: 2d fe e9 77 ff ff ff 44 89 e1 80 e1 07 80 c1 03 38 c1 0f 8c 72 fe ff ff 4c 89 e7 e8 08 06 2d fe e9 65 fe ff ff e8 7e 5c d7 fd <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 66 90 55 41 57 41 56 41 55 41
RSP: 0018:ffffc90003cdf690 EFLAGS: 00010293
RAX: ffffffff83b47ee2 RBX: dffffc0000000000 RCX: ffff88801ed1d7c0
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: 00000000fffffff4 R08: ffffffff83b47e04 R09: 00000000ffffffff
R10: fffffbfff1a8331b R11: 1ffffffff1a8331a R12: 0000000000000000
R13: ffff888019cd6808 R14: ffff88807d740b40 R15: 0000000000000800
FS:  000055555600b300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020017000 CR3: 0000000020491000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __set_extent_bit+0x16f2/0x1c90 fs/btrfs/extent-io-tree.c:1019
 set_record_extent_bits+0x52/0x80 fs/btrfs/extent-io-tree.c:1690
 qgroup_reserve_data+0x27b/0x6f0 fs/btrfs/qgroup.c:3758
 btrfs_qgroup_reserve_data+0x2a/0xc0 fs/btrfs/qgroup.c:3801
 btrfs_check_data_free_space+0x144/0x240 fs/btrfs/delalloc-space.c:154
 btrfs_buffered_write+0x580/0x1730 fs/btrfs/file.c:1253
 btrfs_do_write_iter+0x421/0x1280 fs/btrfs/file.c:1677
 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:0x7f8ec4ae6db9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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:00007ffc02595288 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f8ec4ae6db9
RDX: 00000000000ffe00 RSI: 0000000020004200 RDI: 0000000000000005
RBP: 00007ffc02595290 R08: 0000000000000001 R09: 00007f8ec4aa0035
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:set_state_bits fs/btrfs/extent-io-tree.c:379 [inline]
RIP: 0010:insert_state_fast+0x242/0x250 fs/btrfs/extent-io-tree.c:437
Code: 2d fe e9 77 ff ff ff 44 89 e1 80 e1 07 80 c1 03 38 c1 0f 8c 72 fe ff ff 4c 89 e7 e8 08 06 2d fe e9 65 fe ff ff e8 7e 5c d7 fd <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 66 90 55 41 57 41 56 41 55 41
RSP: 0018:ffffc90003cdf690 EFLAGS: 00010293
RAX: ffffffff83b47ee2 RBX: dffffc0000000000 RCX: ffff88801ed1d7c0
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: 00000000fffffff4 R08: ffffffff83b47e04 R09: 00000000ffffffff
R10: fffffbfff1a8331b R11: 1ffffffff1a8331a R12: 0000000000000000
R13: ffff888019cd6808 R14: ffff88807d740b40 R15: 0000000000000800
FS:  000055555600b300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020017000 CR3: 0000000020491000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (22):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci2-upstream-fs 2023/01/09 16:36 upstream 1fe4fd6f5cad 1dac8c7a .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] kernel BUG in insert_state_fast
ci2-upstream-fs 2022/11/27 02:48 upstream 644e9524388a f4470a7b .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] kernel BUG in insert_state_fast
ci2-upstream-fs 2022/11/25 21:57 upstream 08ad43d554ba f4470a7b .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2023/01/09 16:58 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ae87308093bc 1dac8c7a .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] kernel BUG in insert_state_fast
ci2-upstream-fs 2022/12/14 01:46 upstream 02bf43c7b7f7 f6511626 .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci2-upstream-fs 2022/12/13 22:13 upstream 02bf43c7b7f7 f6511626 .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci2-upstream-fs 2022/12/13 19:39 upstream 764822972d64 f6511626 .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci2-upstream-fs 2022/11/25 20:58 upstream 08ad43d554ba f4470a7b .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2023/01/29 02:49 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c62c88e05937 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2023/01/28 06:34 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c62c88e05937 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2023/01/26 16:05 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 2e84eedb182e 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2023/01/20 15:00 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 9598c377d828 559a440a .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2023/01/19 19:03 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 9598c377d828 1b826a2f .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2023/01/06 04:06 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 247f34f7b803 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2023/01/05 08:13 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2022/12/28 02:18 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 44712fbc .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2022/12/27 01:24 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2022/12/25 05:52 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2022/12/21 04:32 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 d3e76707 .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2022/12/19 03:53 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 05494336 .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2022/12/18 19:35 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 05494336 .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
ci-upstream-gce-arm64 2022/12/18 16:33 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a5541c0811a0 05494336 .config console log report info [disk image] [vmlinux] [kernel image] kernel BUG in insert_state_fast
* Struck through repros no longer work on HEAD.