syzbot


WARNING: refcount bug in __btrfs_release_delayed_node

Status: auto-obsoleted due to no activity on 2023/09/28 02:56
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+2bf8c3b6bedb88990d40@syzkaller.appspotmail.com
First crash: 644d, last: 644d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] WARNING: refcount bug in __btrfs_release_delayed_node 0 (1) 2023/06/26 05:12

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 5056 at lib/refcount.c:28 refcount_warn_saturate+0x107/0x1f0 lib/refcount.c:28
Modules linked in:
CPU: 1 PID: 5056 Comm: syz-executor.4 Not tainted 6.4.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
RIP: 0010:refcount_warn_saturate+0x107/0x1f0 lib/refcount.c:28
Code: 1d c4 8b 51 0a 31 ff 89 de e8 f5 ef 70 fd 84 db 75 a3 e8 0c f4 70 fd 48 c7 c7 c0 d6 a6 8a c6 05 a4 8b 51 0a 01 e8 49 af 38 fd <0f> 0b eb 87 e8 f0 f3 70 fd 0f b6 1d 8d 8b 51 0a 31 ff 89 de e8 c0
RSP: 0018:ffffc900042cfa60 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff8880286bbb80 RSI: ffffffff814c03b7 RDI: 0000000000000001
RBP: ffff8880275112f8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000082828 R12: ffff88802b4cf300
R13: ffff8880275112f8 R14: ffff888027511308 R15: ffff8880275111c8
FS:  0000555556773400(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fcf1bad56be CR3: 000000003f591000 CR4: 0000000000350ee0
Call Trace:
 <TASK>
 __refcount_sub_and_test include/linux/refcount.h:283 [inline]
 __refcount_dec_and_test include/linux/refcount.h:315 [inline]
 refcount_dec_and_test include/linux/refcount.h:333 [inline]
 __btrfs_release_delayed_node.part.0+0xb3b/0xf50 fs/btrfs/delayed-inode.c:263
 __btrfs_release_delayed_node fs/btrfs/delayed-inode.c:251 [inline]
 btrfs_release_delayed_node fs/btrfs/delayed-inode.c:281 [inline]
 btrfs_remove_delayed_node+0x52/0x60 fs/btrfs/delayed-inode.c:1285
 btrfs_evict_inode+0x4f4/0xe50 fs/btrfs/inode.c:5336
 evict+0x2ed/0x6b0 fs/inode.c:665
 dispose_list+0x117/0x1e0 fs/inode.c:698
 evict_inodes+0x345/0x440 fs/inode.c:748
 generic_shutdown_super+0xaf/0x480 fs/super.c:479
 kill_anon_super+0x3a/0x60 fs/super.c:1107
 btrfs_kill_super+0x3c/0x50 fs/btrfs/super.c:2144
 deactivate_locked_super+0x98/0x160 fs/super.c:331
 deactivate_super+0xb1/0xd0 fs/super.c:362
 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1177
 task_work_run+0x16f/0x270 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
 exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297
 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f4b5f28d7f7
Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd5b600188 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f4b5f28d7f7
RDX: 00007ffd5b60025c RSI: 000000000000000a RDI: 00007ffd5b600250
RBP: 00007ffd5b600250 R08: 00000000ffffffff R09: 00007ffd5b600020
R10: 0000555556774893 R11: 0000000000000246 R12: 00007f4b5f2d643b
R13: 00007ffd5b601310 R14: 0000555556774810 R15: 00007ffd5b601350
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/20 02:56 upstream 45a3e24f65e9 d521bc56 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: refcount bug in __btrfs_release_delayed_node
* Struck through repros no longer work on HEAD.