WARNING in __btrfs_free_extent

9 views
Skip to first unread message

syzbot

unread,
Dec 13, 2022, 10:41:46 PM12/13/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11327bff880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=229dc7e0f919106eb073
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+229dc7...@syzkaller.appspotmail.com

R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff760ff9ef R14: 00007fdf3152f300 R15: 0000000000022000
BTRFS error (device loop3): tree block 5275648 owner 1 already locked by pid=22135, extent tree corruption detected
------------[ cut here ]------------
WARNING: CPU: 1 PID: 22135 at fs/btrfs/extent-tree.c:6808 __btrfs_free_extent.isra.0+0x73b/0x1450 fs/btrfs/extent-tree.c:6808
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 22135 Comm: syz-executor.3 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
panic+0x26a/0x50e kernel/panic.c:186
__warn.cold+0x20/0x5a kernel/panic.c:541
report_bug+0x262/0x2b0 lib/bug.c:183
fixup_bug arch/x86/kernel/traps.c:178 [inline]
fixup_bug arch/x86/kernel/traps.c:173 [inline]
do_error_trap+0x1d7/0x310 arch/x86/kernel/traps.c:296
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1038
RIP: 0010:__btrfs_free_extent.isra.0+0x73b/0x1450 fs/btrfs/extent-tree.c:6808
Code: 89 ee bf fb ff ff ff e8 e3 3e 7f fe 41 83 fd fb 0f 84 0c d1 16 05 e8 64 3d 7f fe 44 89 ee 48 c7 c7 40 23 a4 88 e8 3a 75 0f 05 <0f> 0b e8 4e 3d 7f fe 48 8b 7c 24 28 44 89 e9 ba 98 1a 00 00 48 c7
RSP: 0018:ffff888047f870f8 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000040000 RSI: ffffffff814dff01 RDI: ffffed1008ff0e11
RBP: ffff8880565a9840 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000000
R13: 00000000ffffff8b R14: 0000000000000000 R15: 0000000000503000
run_delayed_tree_ref fs/btrfs/extent-tree.c:2339 [inline]
run_one_delayed_ref fs/btrfs/extent-tree.c:2364 [inline]
__btrfs_run_delayed_refs+0x172b/0x3de0 fs/btrfs/extent-tree.c:2638
btrfs_run_delayed_refs.part.0+0x9a/0x310 fs/btrfs/extent-tree.c:2936
btrfs_run_delayed_refs+0xad/0xf0 fs/btrfs/extent-tree.c:2925
btrfs_commit_transaction+0x173/0x2480 fs/btrfs/transaction.c:1972
insert_balance_item.isra.0+0x138/0x1430 fs/btrfs/volumes.c:3082
btrfs_balance+0xd8f/0x3f30 fs/btrfs/volumes.c:3865
btrfs_ioctl_balance+0x66c/0x750 fs/btrfs/ioctl.c:5141
btrfs_ioctl+0xd80/0x76d0 fs/btrfs/ioctl.c:6001
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fdf32fbd0d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fdf3152f168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fdf330dcf80 RCX: 00007fdf32fbd0d9
RDX: 0000000020001800 RSI: 00000000c4009420 RDI: 0000000000000004
RBP: 00007fdf3152f1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff760ff9ef R14: 00007fdf3152f300 R15: 0000000000022000
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Dec 20, 2022, 4:52:28 AM12/20/22
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1429a0cd880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=229dc7e0f919106eb073
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=101d6f57880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13eb8f57880000
mounted in repro: https://storage.googleapis.com/syzbot-assets/393561b2b677/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+229dc7...@syzkaller.appspotmail.com

R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
BTRFS error (device loop0): tree block 5275648 owner 1 already locked by pid=8120, extent tree corruption detected
------------[ cut here ]------------
WARNING: CPU: 1 PID: 8120 at fs/btrfs/extent-tree.c:6808 __btrfs_free_extent.isra.0+0x73b/0x1450 fs/btrfs/extent-tree.c:6808
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 8120 Comm: syz-executor306 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
panic+0x26a/0x50e kernel/panic.c:186
__warn.cold+0x20/0x5a kernel/panic.c:541
report_bug+0x262/0x2b0 lib/bug.c:183
fixup_bug arch/x86/kernel/traps.c:178 [inline]
fixup_bug arch/x86/kernel/traps.c:173 [inline]
do_error_trap+0x1d7/0x310 arch/x86/kernel/traps.c:296
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1038
RIP: 0010:__btrfs_free_extent.isra.0+0x73b/0x1450 fs/btrfs/extent-tree.c:6808
Code: 89 ee bf fb ff ff ff e8 e3 3e 7f fe 41 83 fd fb 0f 84 0c d1 16 05 e8 64 3d 7f fe 44 89 ee 48 c7 c7 40 23 a4 88 e8 3a 75 0f 05 <0f> 0b e8 4e 3d 7f fe 48 8b 7c 24 28 44 89 e9 ba 98 1a 00 00 48 c7
RSP: 0018:ffff888095cdf0f8 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff814dff01 RDI: ffffed1012b9be11
RBP: ffff8880b48cd210 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000000
R13: 00000000ffffff8b R14: 0000000000000000 R15: 0000000000503000
run_delayed_tree_ref fs/btrfs/extent-tree.c:2339 [inline]
run_one_delayed_ref fs/btrfs/extent-tree.c:2364 [inline]
__btrfs_run_delayed_refs+0x172b/0x3de0 fs/btrfs/extent-tree.c:2638
btrfs_run_delayed_refs.part.0+0x9a/0x310 fs/btrfs/extent-tree.c:2936
btrfs_run_delayed_refs+0xad/0xf0 fs/btrfs/extent-tree.c:2925
btrfs_commit_transaction+0x173/0x2480 fs/btrfs/transaction.c:1972
insert_balance_item.isra.0+0x138/0x1430 fs/btrfs/volumes.c:3082
btrfs_balance+0xd8f/0x3f30 fs/btrfs/volumes.c:3865
btrfs_ioctl_balance+0x620/0x750 fs/btrfs/ioctl.c:5141
btrfs_ioctl+0xd80/0x76d0 fs/btrfs/ioctl.c:6001
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f0df1caece9
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:00007ffe45060898 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f0df1caece9
RDX: 0000000000000000 RSI: 00000000c4009420 RDI: 0000000000000004
RBP: 00007ffe450608a0 R08: 0000000000000001 R09: 00007f0df1c60036
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Reply all
Reply to author
Forward
0 new messages