kernel BUG in find_free_extent

10 views
Skip to first unread message

syzbot

unread,
Nov 28, 2022, 1:01:01 AM11/28/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=137b0187880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=002d5a495e384b9bf0d1
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+002d5a...@syzkaller.appspotmail.com

RDX: 0000000000000000 RSI: 00000000c4009420 RDI: 0000000000000004
RBP: 00007fa1a895b1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc9cb8d99f R14: 00007fa1a895b300 R15: 0000000000022000
------------[ cut here ]------------
kernel BUG at fs/btrfs/extent-tree.c:7391!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 16101 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:find_free_extent+0x2995/0x3b50 fs/btrfs/extent-tree.c:7391
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 06 0f 00 00 49 8b 7d 30 4c 89 e1 48 89 ea e8 65 cb 13 00 e9 38 e6 ff ff e8 5b e7 7f fe <0f> 0b e8 54 e7 7f fe 65 ff 05 2d 41 1f 7d 48 c7 c0 48 39 10 8b 48
RSP: 0018:ffff8880aa4fef80 EFLAGS: 00010246
RAX: 0000000000040000 RBX: 00000000fffffff4 RCX: ffffc9000602c000
RDX: 0000000000040000 RSI: ffffffff82e29e15 RDI: 0000000000000005
RBP: ffff888095761cc0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000005
R13: ffff888095761b40 R14: 0000000000000000 R15: ffff888095761b40
FS: 00007fa1a895b700(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4560010d20 CR3: 000000004aafa000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
btrfs_reserve_extent+0x296/0x440 fs/btrfs/extent-tree.c:7820
btrfs_alloc_tree_block+0x3f2/0x15f0 fs/btrfs/extent-tree.c:8279
alloc_tree_block_no_bg_flush+0x1b6/0x250 fs/btrfs/ctree.c:1039
__btrfs_cow_block+0x3c7/0x10a0 fs/btrfs/ctree.c:1094
btrfs_cow_block+0x276/0x840 fs/btrfs/ctree.c:1557
btrfs_search_slot+0x66a/0x1ee0 fs/btrfs/ctree.c:2881
btrfs_insert_empty_items+0xba/0x180 fs/btrfs/ctree.c:4910
btrfs_insert_empty_item fs/btrfs/ctree.h:2923 [inline]
insert_balance_item.isra.0+0x112/0x1430 fs/btrfs/volumes.c:3060
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:0x7fa1aa3e90d9
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:00007fa1a895b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fa1aa508f80 RCX: 00007fa1aa3e90d9
RDX: 0000000000000000 RSI: 00000000c4009420 RDI: 0000000000000004
RBP: 00007fa1a895b1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc9cb8d99f R14: 00007fa1a895b300 R15: 0000000000022000
Modules linked in:
---[ end trace 4a81312fc1df3b17 ]---
RIP: 0010:find_free_extent+0x2995/0x3b50 fs/btrfs/extent-tree.c:7391
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 06 0f 00 00 49 8b 7d 30 4c 89 e1 48 89 ea e8 65 cb 13 00 e9 38 e6 ff ff e8 5b e7 7f fe <0f> 0b e8 54 e7 7f fe 65 ff 05 2d 41 1f 7d 48 c7 c0 48 39 10 8b 48
RSP: 0018:ffff8880aa4fef80 EFLAGS: 00010246
RAX: 0000000000040000 RBX: 00000000fffffff4 RCX: ffffc9000602c000
RDX: 0000000000040000 RSI: ffffffff82e29e15 RDI: 0000000000000005
RBP: ffff888095761cc0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000005
R13: ffff888095761b40 R14: 0000000000000000 R15: ffff888095761b40
FS: 00007fa1a895b700(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4564011078 CR3: 000000004aafa000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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,
Nov 28, 2022, 1:15:36 AM11/28/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=15727375880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=002d5a495e384b9bf0d1
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15ed7ca1880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14ddfd53880000
mounted in repro: https://storage.googleapis.com/syzbot-assets/fffc9996c88b/mount_0.gz

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

RDX: 0000000000000000 RSI: 00000000c4009420 RDI: 0000000000000004
RBP: 00007fff4e007b70 R08: 0000000000000001 R09: 00007fff4e007b80
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 00007fff4e007bb0 R14: 00007fff4e007b90 R15: 0000000000000002
------------[ cut here ]------------
kernel BUG at fs/btrfs/extent-tree.c:7391!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 8165 Comm: syz-executor397 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:find_free_extent+0x2995/0x3b50 fs/btrfs/extent-tree.c:7391
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 06 0f 00 00 49 8b 7d 30 4c 89 e1 48 89 ea e8 65 cb 13 00 e9 38 e6 ff ff e8 5b e7 7f fe <0f> 0b e8 54 e7 7f fe 65 ff 05 2d 41 1f 7d 48 c7 c0 48 39 10 8b 48
RSP: 0018:ffff88809c456f80 EFLAGS: 00010293
RAX: ffff8880941c6400 RBX: 00000000fffffff4 RCX: ffffffff82e2938d
RDX: 0000000000000000 RSI: ffffffff82e29e15 RDI: 0000000000000005
RBP: ffff8880afad9380 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000005
R13: ffff8880afad9200 R14: 0000000000000000 R15: ffff8880afad9200
FS: 0000555555d10300(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056059ed168b8 CR3: 0000000097056000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
btrfs_reserve_extent+0x296/0x440 fs/btrfs/extent-tree.c:7820
btrfs_alloc_tree_block+0x3f2/0x15f0 fs/btrfs/extent-tree.c:8279
alloc_tree_block_no_bg_flush+0x1b6/0x250 fs/btrfs/ctree.c:1039
__btrfs_cow_block+0x3c7/0x10a0 fs/btrfs/ctree.c:1094
btrfs_cow_block+0x276/0x840 fs/btrfs/ctree.c:1557
btrfs_search_slot+0x66a/0x1ee0 fs/btrfs/ctree.c:2881
btrfs_insert_empty_items+0xba/0x180 fs/btrfs/ctree.c:4910
btrfs_insert_empty_item fs/btrfs/ctree.h:2923 [inline]
insert_balance_item.isra.0+0x112/0x1430 fs/btrfs/volumes.c:3060
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:0x7fc9ef229aa9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 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:00007fff4e007b48 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fc9ef229aa9
RDX: 0000000000000000 RSI: 00000000c4009420 RDI: 0000000000000004
RBP: 00007fff4e007b70 R08: 0000000000000001 R09: 00007fff4e007b80
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 00007fff4e007bb0 R14: 00007fff4e007b90 R15: 0000000000000002
Modules linked in:
---[ end trace 7c87b5cf65b26561 ]---
RIP: 0010:find_free_extent+0x2995/0x3b50 fs/btrfs/extent-tree.c:7391
Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 06 0f 00 00 49 8b 7d 30 4c 89 e1 48 89 ea e8 65 cb 13 00 e9 38 e6 ff ff e8 5b e7 7f fe <0f> 0b e8 54 e7 7f fe 65 ff 05 2d 41 1f 7d 48 c7 c0 48 39 10 8b 48
RSP: 0018:ffff88809c456f80 EFLAGS: 00010293
RAX: ffff8880941c6400 RBX: 00000000fffffff4 RCX: ffffffff82e2938d
RDX: 0000000000000000 RSI: ffffffff82e29e15 RDI: 0000000000000005
RBP: ffff8880afad9380 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000005
R13: ffff8880afad9200 R14: 0000000000000000 R15: ffff8880afad9200
FS: 0000555555d10300(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056059ed168b8 CR3: 0000000097056000 CR4: 00000000003406e0

syzbot

unread,
Dec 4, 2022, 11:16:38 PM12/4/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 179ef7fe8677 Linux 4.14.300
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17de110f880000
kernel config: https://syzkaller.appspot.com/x/.config?x=aa85f51ec321d5a9
dashboard link: https://syzkaller.appspot.com/bug?extid=055c405faefc5aa04346
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=179eb2f5880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=116b3d37880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d311ef57b59a/disk-179ef7fe.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/25bf5d729f69/vmlinux-179ef7fe.xz
kernel image: https://storage.googleapis.com/syzbot-assets/db9b96571e69/bzImage-179ef7fe.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/93e914b77ee3/mount_0.gz

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

vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:500 [inline]
do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
SYSC_ioctl fs/ioctl.c:701 [inline]
SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
------------[ cut here ]------------
kernel BUG at fs/btrfs/extent-tree.c:7723!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
Modules linked in:
CPU: 1 PID: 8004 Comm: syz-executor109 Not tainted 4.14.300-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
task: ffff888096bf20c0 task.stack: ffff888096730000
RIP: 0010:find_free_extent+0x203b/0x3320 fs/btrfs/extent-tree.c:7723
RSP: 0018:ffff888096737148 EFLAGS: 00010297
RAX: ffff888096bf20c0 RBX: ffff88809629afb0 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 00000000ffffffff RDI: 0000000000000286
RBP: ffff888096dd6ac0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000005
R13: 0000000000000000 R14: ffff888096891cc0 R15: ffff888096dd6940
FS: 0000555556de5300(0000) GS:ffff8880ba500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f42ccc65740 CR3: 00000000a17dc000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
btrfs_reserve_extent+0x14b/0x3b0 fs/btrfs/extent-tree.c:8109
btrfs_alloc_tree_block+0x371/0x1410 fs/btrfs/extent-tree.c:8551
__btrfs_cow_block+0x367/0xfd0 fs/btrfs/ctree.c:1113
btrfs_cow_block+0x207/0x6d0 fs/btrfs/ctree.c:1574
btrfs_search_slot+0x546/0x1c20 fs/btrfs/ctree.c:2818
btrfs_insert_empty_items+0xaf/0x160 fs/btrfs/ctree.c:4866
btrfs_insert_empty_item fs/btrfs/ctree.h:2879 [inline]
insert_balance_item.isra.0+0xef/0x13f0 fs/btrfs/volumes.c:3071
btrfs_balance+0xa50/0x39b0 fs/btrfs/volumes.c:3889
btrfs_ioctl_balance+0x5e6/0x730 fs/btrfs/ioctl.c:4846
btrfs_ioctl+0xddf/0x5b20 fs/btrfs/ioctl.c:5687
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:500 [inline]
do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
SYSC_ioctl fs/ioctl.c:701 [inline]
SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
Code: 02 00 0f 85 ed 0f 00 00 49 8b 7f 30 4c 89 ca 4c 89 e1 4c 89 4c 24 20 e8 74 57 11 00 4c 8b 4c 24 20 e9 e9 ea ff ff e8 35 27 ba fe <0f> 0b e8 2e 27 ba fe 49 8d bf b0 00 00 00 e8 b2 bd a5 fe e9 b3
RIP: find_free_extent+0x203b/0x3320 fs/btrfs/extent-tree.c:7723 RSP: ffff888096737148
---[ end trace 567c9a84a22d39e0 ]---


---
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 can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages