syzbot


WARNING in btrfs_space_info_update_bytes_may_use

Status: upstream: reported C repro on 2022/10/31 00:15
Reported-by: syzbot+8edfa01e46fd9fe3fbfb@syzkaller.appspotmail.com
First crash: 27d, last: 19h15m

Cause bisection: introduced by (bisect log) :
commit 0c7c575df56b957390206deb018c41acbb412159
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
Date: Wed Feb 24 20:01:52 2021 +0000

  mm/filemap: remove dynamically allocated array from filemap_read

Crash: WARNING in btrfs_space_info_update_bytes_may_use (log)
Repro: C syz .config

Sample crash report:
BTRFS info (device loop0): enabling ssd optimizations
------------[ cut here ]------------
WARNING: CPU: 0 PID: 3604 at fs/btrfs/space-info.h:122 btrfs_space_info_update_bytes_may_use+0x524/0x820 fs/btrfs/space-info.h:122
Modules linked in:
CPU: 0 PID: 3604 Comm: syz-executor245 Not tainted 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
RIP: 0010:btrfs_space_info_update_bytes_may_use+0x524/0x820 fs/btrfs/space-info.h:122
Code: fd e9 77 fb ff ff e8 3b 4b fd fd 4d 89 e6 48 89 de 49 f7 de 4c 89 f7 e8 9a 47 fd fd 49 39 de 0f 86 b5 fc ff ff e8 1c 4b fd fd <0f> 0b 31 db e9 af fc ff ff e8 0e 4b fd fd 48 8d 7d 18 be ff ff ff
RSP: 0018:ffffc90003f4f9c0 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000000d0000 RCX: 0000000000000000
RDX: ffff888021f78000 RSI: ffffffff837f5164 RDI: 0000000000000006
RBP: ffff88807da53000 R08: 0000000000000006 R09: 00000000000e0000
R10: 00000000000d0000 R11: 000000000008c07e R12: fffffffffff20000
R13: ffff88807da53060 R14: 00000000000e0000 R15: 0000000000000002
FS:  0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007faff6153690 CR3: 000000000bc8e000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 btrfs_space_info_free_bytes_may_use fs/btrfs/space-info.h:154 [inline]
 block_rsv_release_bytes fs/btrfs/block-rsv.c:151 [inline]
 btrfs_block_rsv_release+0x515/0x650 fs/btrfs/block-rsv.c:295
 btrfs_release_global_block_rsv+0x22/0x2e0 fs/btrfs/block-rsv.c:463
 btrfs_free_block_groups+0x954/0x1100 fs/btrfs/block-group.c:4051
 close_ctree+0xd17/0xdc3 fs/btrfs/disk-io.c:4710
 generic_shutdown_super+0x154/0x410 fs/super.c:491
 kill_anon_super+0x36/0x60 fs/super.c:1085
 btrfs_kill_super+0x38/0x50 fs/btrfs/super.c:2441
 deactivate_locked_super+0x94/0x160 fs/super.c:331
 deactivate_super+0xad/0xd0 fs/super.c:362
 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1186
 task_work_run+0x16b/0x270 kernel/task_work.c:179
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0xb35/0x2a20 kernel/exit.c:820
 do_group_exit+0xd0/0x2a0 kernel/exit.c:950
 __do_sys_exit_group kernel/exit.c:961 [inline]
 __se_sys_exit_group kernel/exit.c:959 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:959
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f87197f03e9
Code: Unable to access opcode bytes at 0x7f87197f03bf.
RSP: 002b:00007ffebfd5c0d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f871987d470 RCX: 00007f87197f03e9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 0000000000000001 R08: ffffffffffffffb8 R09: 00007ffebf003031
R10: 0000000080000009 R11: 0000000000000246 R12: 00007f871987d470
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
 </TASK>

Crashes (14):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/10/30 18:58 upstream b229b6ca5abb 2a71366b .config log report syz C WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-kasan-gce-root 2022/11/26 07:10 upstream 0b1dcc2cf55a 74a66371 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-kasan-gce-root 2022/11/25 19:14 upstream 08ad43d554ba 74a66371 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-kasan-gce-root 2022/11/25 14:27 upstream 08ad43d554ba 74a66371 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-kasan-gce-root 2022/11/25 03:52 upstream c3eb11fbb826 62e26685 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-kasan-gce-root 2022/11/25 02:24 upstream c3eb11fbb826 62e26685 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-kasan-gce-root 2022/11/25 01:01 upstream c3eb11fbb826 62e26685 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-kasan-gce-root 2022/11/24 22:07 upstream c3eb11fbb826 62e26685 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-kasan-gce-root 2022/11/23 05:27 upstream eb7081409f94 9da37ae8 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-kasan-gce-root 2022/11/19 21:56 upstream fe24a97cf254 5bb70014 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-qemu-upstream-386 2022/11/23 19:38 upstream eb7081409f94 3c2d90bc .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-qemu-upstream-386 2022/11/21 18:51 upstream eb7081409f94 f9a97739 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-linux-next-kasan-gce-root 2022/11/24 02:07 linux-next 15f3bff12cf6 12c66417 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
ci-upstream-linux-next-kasan-gce-root 2022/11/22 05:30 linux-next 15f3bff12cf6 1c576c23 .config log report info WARNING in btrfs_space_info_update_bytes_may_use
* Struck through repros no longer work on HEAD.