syzbot


WARNING in btrfs_free_reserved_data_space_noquota

Status: fixed on 2024/05/19 05:34
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+adec8406ad17413d4c06@syzkaller.appspotmail.com
Fix commit: 9e65bfca24cf btrfs: fix qgroup_free_reserved_data int overflow
First crash: 711d, last: 298d
Cause bisection: introduced by (bisect log) :
commit c814bf958926ff45a9c1e899bd001006ab6cfbae
Author: ye xingchen <ye.xingchen@zte.com.cn>
Date: Tue Aug 16 10:51:06 2022 +0000

  powerpc/selftests: Use timersub() for gettimeofday()

Crash: kernel BUG in close_ctree (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit 487c20b016dc48230367a7be017f40313e53e3bd
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Thu Mar 30 21:53:51 2023 +0000

  iov: improve copy_iovec_from_user() code generation

  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] WARNING in btrfs_free_reserved_data_space_noquota 2 (4) 2024/05/16 15:38
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING in btrfs_free_reserved_data_space_noquota (2) btrfs 1 142d 138d 0/28 auto-obsoleted due to no activity on 2024/09/27 21:32
upstream WARNING in btrfs_free_reserved_data_space_noquota (3) btrfs C 4 7h55m 17d 0/28 upstream: reported C repro on 2024/10/22 14:15
Last patch testing requests (10)
Created Duration User Patch Repo Result
2024/04/23 13:24 2h58m retest repro linux-next error
2024/03/02 14:36 24m retest repro upstream OK log
2024/02/17 13:51 22m retest repro upstream OK log
2024/01/30 21:21 22m retest repro linux-next error
2023/12/23 13:40 11m retest repro upstream report log
2023/12/09 13:24 14m retest repro upstream report log
2023/11/16 00:49 19m retest repro linux-next report log
2023/11/03 05:43 19m retest repro upstream OK log
2023/09/06 04:04 16m retest repro linux-next report log
2023/08/25 05:04 38m retest repro upstream report log
Fix bisection attempts (6)
Created Duration User Patch Repo Result
2023/08/01 05:04 4h21m bisect fix upstream OK (1) job log
2023/06/24 16:58 26m bisect fix upstream OK (0) job log log
2023/05/25 05:54 25m bisect fix upstream OK (0) job log log
2023/04/25 05:00 52m bisect fix upstream OK (0) job log log
2023/03/14 01:35 1h10m bisect fix upstream OK (0) job log log
2023/02/12 00:49 41m bisect fix upstream OK (0) job log log

Sample crash report:
RBP: 00007ffd0ae01b60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000008000000 R11: 0000000000000246 R12: 0000000000000006
R13: 00007ffd0ae01ba0 R14: 00007ffd0ae01b80 R15: 0000000000000001
 </TASK>
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5100 at fs/btrfs/space-info.h:199 btrfs_space_info_update_bytes_may_use fs/btrfs/space-info.h:199 [inline]
WARNING: CPU: 0 PID: 5100 at fs/btrfs/space-info.h:199 btrfs_space_info_free_bytes_may_use fs/btrfs/space-info.h:231 [inline]
WARNING: CPU: 0 PID: 5100 at fs/btrfs/space-info.h:199 btrfs_free_reserved_data_space_noquota+0x449/0x660 fs/btrfs/delalloc-space.c:181
Modules linked in:
CPU: 0 PID: 5100 Comm: syz-executor453 Not tainted 6.2.0-rc3-next-20230112-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:btrfs_space_info_update_bytes_may_use fs/btrfs/space-info.h:199 [inline]
RIP: 0010:btrfs_space_info_free_bytes_may_use fs/btrfs/space-info.h:231 [inline]
RIP: 0010:btrfs_free_reserved_data_space_noquota+0x449/0x660 fs/btrfs/delalloc-space.c:181
Code: c1 ea 03 80 3c 02 00 0f 85 fd 01 00 00 48 8b 5d 60 4c 89 ef 48 89 de e8 85 ca fe fd 49 39 dd 0f 86 07 fe ff ff e8 27 ce fe fd <0f> 0b 31 db e9 01 fe ff ff e8 19 ce fe fd 48 8d 7d 18 be ff ff ff
RSP: 0018:ffffc90003bcf408 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000005cb000 RCX: 0000000000000000
RDX: ffff88802b453a80 RSI: ffffffff8382eeb9 RDI: 0000000000000006
RBP: ffff888075b5e000 R08: 0000000000000006 R09: 0000000000800000
R10: 00000000005cb000 R11: 0000000000000000 R12: ffff888028db4000
R13: 0000000000800000 R14: 0000000000000000 R15: 0000000000800000
FS:  0000555555b26300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fec3da9f0e0 CR3: 000000001bfa3000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 btrfs_free_reserved_data_space+0xc1/0x100 fs/btrfs/delalloc-space.c:201
 btrfs_dio_iomap_begin+0xcae/0x21b0 fs/btrfs/inode.c:7849
 iomap_iter+0x488/0x1530 fs/iomap/iter.c:91
 __iomap_dio_rw+0x72c/0x1cf0 fs/iomap/direct-io.c:600
 btrfs_dio_write+0x94/0xd0 fs/btrfs/inode.c:8177
 btrfs_direct_write fs/btrfs/file.c:1529 [inline]
 btrfs_do_write_iter+0xb29/0x1470 fs/btrfs/file.c:1674
 call_write_iter include/linux/fs.h:1852 [inline]
 do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735
 do_iter_write+0x182/0x700 fs/read_write.c:861
 vfs_writev+0x1aa/0x670 fs/read_write.c:934
 do_pwritev+0x1b6/0x270 fs/read_write.c:1031
 __do_sys_pwritev2 fs/read_write.c:1090 [inline]
 __se_sys_pwritev2 fs/read_write.c:1081 [inline]
 __x64_sys_pwritev2+0xef/0x150 fs/read_write.c:1081
 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:0x7fb379717ec9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 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:00007ffd0ae01b28 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fb379717ec9
RDX: 0000000000000001 RSI: 0000000020000280 RDI: 0000000000000005
RBP: 00007ffd0ae01b60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000008000000 R11: 0000000000000246 R12: 0000000000000006
R13: 00007ffd0ae01ba0 R14: 00007ffd0ae01b80 R15: 0000000000000001
 </TASK>

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/13 00:49 linux-next 0a093b2893c7 96166539 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root WARNING in btrfs_free_reserved_data_space_noquota
2023/11/25 13:21 upstream 0f5cc96c367f 5b429f39 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs WARNING in btrfs_free_reserved_data_space_noquota
2022/11/28 19:36 upstream b7b275e60bcd 247de55b .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs WARNING in btrfs_free_reserved_data_space_noquota
2023/11/25 11:06 upstream 0f5cc96c367f 5b429f39 .config console log report syz C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-qemu-upstream WARNING in btrfs_free_reserved_data_space_noquota
2023/03/26 04:59 upstream 4bdec23f971b fbf0499a .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-smack-root WARNING in btrfs_free_reserved_data_space_noquota
2024/01/15 19:32 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING in btrfs_free_reserved_data_space_noquota
2023/11/25 10:56 upstream 0f5cc96c367f 5b429f39 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING in btrfs_free_reserved_data_space_noquota
* Struck through repros no longer work on HEAD.