2024-05-03 21:24:58

by syzbot

[permalink] [raw]
Subject: [syzbot] [bcachefs?] kernel BUG in bch2_fs_recovery

Hello,

syzbot found the following issue on:

HEAD commit: 3d25a941ea50 Merge tag 'block-6.9-20240503' of git://git.k..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=114b39ff180000
kernel config: https://syzkaller.appspot.com/x/.config?x=3310e643b6ef5d69
dashboard link: https://syzkaller.appspot.com/bug?extid=05c1843ef85da9e52042
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13aed9df180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14ac7a28980000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7bc7510fe41f/non_bootable_disk-3d25a941.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/9d8ed74e49f1/vmlinux-3d25a941.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d724e9151b52/bzImage-3d25a941.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/998b7ff57836/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq afc6cc17f332ffe0 written 24 min_key POS_MIN durability: 0 (invalid extent entry 0000000000020040)
invalid extent entry type (got 6, max 6), shutting down
bcachefs (loop0): inconsistency detected - emergency read only at journal seq 0
------------[ cut here ]------------
kernel BUG at arch/x86/mm/physaddr.c:23!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 2 PID: 5178 Comm: syz-executor317 Not tainted 6.9.0-rc6-syzkaller-00227-g3d25a941ea50 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:__phys_addr+0x120/0x150 arch/x86/mm/physaddr.c:23
Code: 10 00 75 39 48 8b 1d 4f c8 1b 0c 48 89 ee bf ff ff ff 1f e8 72 49 4f 00 48 01 eb 48 81 fd ff ff ff 1f 76 a7 e8 51 4e 4f 00 90 <0f> 0b 48 c7 c7 bd 39 9f 8f e8 b2 99 aa 00 e9 52 ff ff ff 48 c7 c7
RSP: 0018:ffffc900032ef4a0 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 000000007ffff75e RCX: ffffffff813e77ce
RDX: ffff888011aca440 RSI: ffffffff813e77df RDI: 0000000000000007
RBP: 000000007ffff75e R08: 0000000000000007 R09: 000000001fffffff
R10: 000000007ffff75e R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000001 R14: 00000000663551f8 R15: ffffed1005ea010e
FS: 000055557a454380(0000) GS:ffff88806b400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff7a9096410 CR3: 00000000203ec000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
virt_to_folio include/linux/mm.h:1306 [inline]
kfree+0x6c/0x390 mm/slub.c:4382
bch2_fs_recovery+0xfe9/0x3c40 fs/bcachefs/recovery.c:905
bch2_fs_start+0x2e9/0x600 fs/bcachefs/super.c:1043
bch2_fs_open+0xf87/0x1110 fs/bcachefs/super.c:2102
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8f/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1ad400a8fa
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 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:00007ffd674e3108 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffd674e3120 RCX: 00007f1ad400a8fa
RDX: 0000000020011a00 RSI: 0000000020000080 RDI: 00007ffd674e3120
RBP: 0000000000000004 R08: 00007ffd674e3160 R09: 00000000000119fd
R10: 0000000000000000 R11: 0000000000000282 R12: 0000000000000000
R13: 00007ffd674e3160 R14: 0000000000000003 R15: 0000000001000000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__phys_addr+0x120/0x150 arch/x86/mm/physaddr.c:23
Code: 10 00 75 39 48 8b 1d 4f c8 1b 0c 48 89 ee bf ff ff ff 1f e8 72 49 4f 00 48 01 eb 48 81 fd ff ff ff 1f 76 a7 e8 51 4e 4f 00 90 <0f> 0b 48 c7 c7 bd 39 9f 8f e8 b2 99 aa 00 e9 52 ff ff ff 48 c7 c7
RSP: 0018:ffffc900032ef4a0 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 000000007ffff75e RCX: ffffffff813e77ce
RDX: ffff888011aca440 RSI: ffffffff813e77df RDI: 0000000000000007
RBP: 000000007ffff75e R08: 0000000000000007 R09: 000000001fffffff
R10: 000000007ffff75e R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000001 R14: 00000000663551f8 R15: ffffed1005ea010e
FS: 000055557a454380(0000) GS:ffff88806b400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff7a9096410 CR3: 00000000203ec000 CR4: 0000000000350ef0
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 [email protected].

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

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup


2024-05-08 04:59:23

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [bcachefs?] kernel BUG in bch2_fs_recovery

syzbot has bisected this issue to:

commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b
Author: Kent Overstreet <[email protected]>
Date: Sat Sep 23 22:41:51 2023 +0000

bcachefs: Ignore unknown mount options

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14fdf9a8980000
start commit: ddb4c3f25b7b Merge tag 'for-linus-6.9a-rc7-tag' of git://g..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=16fdf9a8980000
console output: https://syzkaller.appspot.com/x/log.txt?x=12fdf9a8980000
kernel config: https://syzkaller.appspot.com/x/.config?x=d2f00edef461175
dashboard link: https://syzkaller.appspot.com/bug?extid=05c1843ef85da9e52042
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1464ea2f180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=130db31f180000

Reported-by: [email protected]
Fixes: 03ef80b469d5 ("bcachefs: Ignore unknown mount options")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

2024-06-09 12:24:14

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [bcachefs?] kernel BUG in bch2_fs_recovery

syzbot suspects this issue was fixed by commit:

commit 7ffec9ccdc6ad8356792f9a7823b1fe9c8a10cbf
Author: Kent Overstreet <[email protected]>
Date: Fri May 3 14:55:17 2024 +0000

bcachefs: don't free error pointers

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=13191932980000
start commit: ddb4c3f25b7b Merge tag 'for-linus-6.9a-rc7-tag' of git://g..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=d2f00edef461175
dashboard link: https://syzkaller.appspot.com/bug?extid=05c1843ef85da9e52042
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1464ea2f180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=130db31f180000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: bcachefs: don't free error pointers

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

2024-06-09 13:31:07

by Kent Overstreet

[permalink] [raw]
Subject: Re: [syzbot] [bcachefs?] kernel BUG in bch2_fs_recovery

On Sun, Jun 09, 2024 at 05:24:02AM -0700, syzbot wrote:
> syzbot suspects this issue was fixed by commit:
>
> commit 7ffec9ccdc6ad8356792f9a7823b1fe9c8a10cbf
> Author: Kent Overstreet <[email protected]>
> Date: Fri May 3 14:55:17 2024 +0000
>
> bcachefs: don't free error pointers
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=13191932980000
> start commit: ddb4c3f25b7b Merge tag 'for-linus-6.9a-rc7-tag' of git://g..
> git tree: upstream
> kernel config: https://syzkaller.appspot.com/x/.config?x=d2f00edef461175
> dashboard link: https://syzkaller.appspot.com/bug?extid=05c1843ef85da9e52042
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1464ea2f180000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=130db31f180000
>
> If the result looks correct, please mark the issue as fixed by replying with:
>
#syz fix: bcachefs: don't free error pointers