[syzbot] [f2fs?] kernel BUG in new_curseg (2)

8 views
Skip to first unread message

syzbot

unread,
Dec 13, 2024, 7:50:23 PM12/13/24
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7cb1b4663150 Merge tag 'locking_urgent_for_v6.13_rc3' of g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=103bc544580000
kernel config: https://syzkaller.appspot.com/x/.config?x=fee25f93665c89ac
dashboard link: https://syzkaller.appspot.com/bug?extid=15669ec8c35ddf6c3d43
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7feb34a89c2a/non_bootable_disk-7cb1b466.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/13e083329dab/vmlinux-7cb1b466.xz
kernel image: https://storage.googleapis.com/syzbot-assets/fe3847d08513/bzImage-7cb1b466.xz

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

------------[ cut here ]------------
kernel BUG at fs/f2fs/segment.c:2746!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5323 Comm: syz.0.0 Not tainted 6.13.0-rc2-syzkaller-00018-g7cb1b4663150 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:get_new_segment fs/f2fs/segment.c:2746 [inline]
RIP: 0010:new_curseg+0x1f52/0x1f70 fs/f2fs/segment.c:2876
Code: fe fd e9 1a fa ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 4c fa ff ff 48 89 df e8 59 37 fe fd e9 3f fa ff ff e8 0f d8 97 fd 90 <0f> 0b e8 07 d8 97 fd 90 0f 0b e8 ff d7 97 fd 90 0f 0b e8 f7 d7 97
RSP: 0018:ffffc9000d22f528 EFLAGS: 00010293
RAX: ffffffff84078631 RBX: 0000000000000018 RCX: ffff88801cf80000
RDX: 0000000000000000 RSI: 0000000000000018 RDI: 0000000000000018
RBP: dffffc0000000000 R08: ffffffff84077465 R09: fffff52001a45e94
R10: dffffc0000000000 R11: fffff52001a45e94 R12: 0000000000000018
R13: ffff888011d6d101 R14: 0000000000000018 R15: ffff888052d722d8
FS: 00007ff3577bc6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffc8f62ba00 CR3: 000000004320a000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__allocate_new_segment+0x1ce/0x940 fs/f2fs/segment.c:3210
f2fs_allocate_new_section fs/f2fs/segment.c:3224 [inline]
f2fs_allocate_pinning_section+0xfa/0x4e0 fs/f2fs/segment.c:3238
f2fs_expand_inode_data+0x696/0xca0 fs/f2fs/file.c:1830
f2fs_fallocate+0x537/0xa10 fs/f2fs/file.c:1940
vfs_fallocate+0x569/0x6e0 fs/open.c:327
do_vfs_ioctl+0x258c/0x2e40 fs/ioctl.c:885
__do_sys_ioctl fs/ioctl.c:904 [inline]
__se_sys_ioctl+0x80/0x170 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff357d7ff19
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff3577bc058 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff357f46160 RCX: 00007ff357d7ff19
RDX: 00000000200000c0 RSI: 0000000040305828 RDI: 0000000000000004
RBP: 00007ff357df3cc8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007ff357f46160 R15: 00007ffc8f62c1e8
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:get_new_segment fs/f2fs/segment.c:2746 [inline]
RIP: 0010:new_curseg+0x1f52/0x1f70 fs/f2fs/segment.c:2876
Code: fe fd e9 1a fa ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 4c fa ff ff 48 89 df e8 59 37 fe fd e9 3f fa ff ff e8 0f d8 97 fd 90 <0f> 0b e8 07 d8 97 fd 90 0f 0b e8 ff d7 97 fd 90 0f 0b e8 f7 d7 97
RSP: 0018:ffffc9000d22f528 EFLAGS: 00010293
RAX: ffffffff84078631 RBX: 0000000000000018 RCX: ffff88801cf80000
RDX: 0000000000000000 RSI: 0000000000000018 RDI: 0000000000000018
RBP: dffffc0000000000 R08: ffffffff84077465 R09: fffff52001a45e94
R10: dffffc0000000000 R11: fffff52001a45e94 R12: 0000000000000018
R13: ffff888011d6d101 R14: 0000000000000018 R15: ffff888052d722d8
FS: 00007ff3577bc6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffc8f62ba00 CR3: 000000004320a000 CR4: 0000000000352ef0
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.

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

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

syzbot

unread,
Feb 10, 2025, 4:42:27 PM2/10/25
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, syzkall...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: a64dcfb451e2 Linux 6.14-rc2
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17297b18580000
kernel config: https://syzkaller.appspot.com/x/.config?x=7f246b548ed0635a
dashboard link: https://syzkaller.appspot.com/bug?extid=15669ec8c35ddf6c3d43
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=103943f8580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12da1bdf980000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7feb34a89c2a/non_bootable_disk-a64dcfb4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/6a816640d31b/vmlinux-a64dcfb4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/b5cb42ffa4f6/bzImage-a64dcfb4.xz
mounted in repro #1: https://storage.googleapis.com/syzbot-assets/caba9b9b8f24/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=14da1bdf980000)
mounted in repro #2: https://storage.googleapis.com/syzbot-assets/270c3c4c1558/mount_6.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=121672a4580000)

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

F2FS-fs (loop0): Found nat_bits in checkpoint
F2FS-fs (loop0): Start checkpoint disabled!
F2FS-fs (loop0): Mounted with checkpoint version = 48b305e6
------------[ cut here ]------------
kernel BUG at fs/f2fs/segment.c:2809!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5304 Comm: syz-executor274 Not tainted 6.14.0-rc2-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:get_new_segment fs/f2fs/segment.c:2809 [inline]
RIP: 0010:new_curseg+0x1f52/0x1f70 fs/f2fs/segment.c:2939
Code: fb fd e9 1a fa ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 4c fa ff ff 48 89 df e8 59 4e fb fd e9 3f fa ff ff e8 5f b5 94 fd 90 <0f> 0b e8 57 b5 94 fd 90 0f 0b e8 4f b5 94 fd 90 0f 0b e8 47 b5 94
RSP: 0018:ffffc9000d0af4a8 EFLAGS: 00010293
RAX: ffffffff842a9a41 RBX: 0000000000000018 RCX: ffff88801ede4880
RDX: 0000000000000000 RSI: 0000000000000018 RDI: 0000000000000018
RBP: dffffc0000000000 R08: ffffffff842a8875 R09: fffff52001a15e84
R10: dffffc0000000000 R11: fffff52001a15e84 R12: 0000000000000018
R13: ffff888043de5101 R14: 0000000000000018 R15: ffff888038298f58
FS: 000055556f014380(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000042a82000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__allocate_new_segment+0x1ce/0x940 fs/f2fs/segment.c:3273
f2fs_allocate_new_section fs/f2fs/segment.c:3287 [inline]
f2fs_allocate_pinning_section+0xfa/0x4e0 fs/f2fs/segment.c:3301
f2fs_expand_inode_data+0x696/0xca0 fs/f2fs/file.c:1849
f2fs_fallocate+0x537/0xa10 fs/f2fs/file.c:1959
vfs_fallocate+0x623/0x7a0 fs/open.c:338
do_vfs_ioctl+0x258c/0x2e40 fs/ioctl.c:885
__do_sys_ioctl fs/ioctl.c:904 [inline]
__se_sys_ioctl+0x80/0x170 fs/ioctl.c:892
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ffbafdefd99
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 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:00007ffecbc98b98 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000400000000080 RCX: 00007ffbafdefd99
RDX: 00004000000000c0 RSI: 0000000040305828 RDI: 0000000000000005
RBP: 0030656c69662f2e R08: 000055556f0154c0 R09: 000055556f0154c0
R10: 0000000000000000 R11: 0000000000000246 R12: 00004000000000c0
R13: 00004000000000e0 R14: 00004000000000c2 R15: 00007ffbafe3903b
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:get_new_segment fs/f2fs/segment.c:2809 [inline]
RIP: 0010:new_curseg+0x1f52/0x1f70 fs/f2fs/segment.c:2939
Code: fb fd e9 1a fa ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 4c fa ff ff 48 89 df e8 59 4e fb fd e9 3f fa ff ff e8 5f b5 94 fd 90 <0f> 0b e8 57 b5 94 fd 90 0f 0b e8 4f b5 94 fd 90 0f 0b e8 47 b5 94
RSP: 0018:ffffc9000d0af4a8 EFLAGS: 00010293
RAX: ffffffff842a9a41 RBX: 0000000000000018 RCX: ffff88801ede4880
RDX: 0000000000000000 RSI: 0000000000000018 RDI: 0000000000000018
RBP: dffffc0000000000 R08: ffffffff842a8875 R09: fffff52001a15e84
R10: dffffc0000000000 R11: fffff52001a15e84 R12: 0000000000000018
R13: ffff888043de5101 R14: 0000000000000018 R15: ffff888038298f58
FS: 000055556f014380(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000042a82000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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.

Chao Yu

unread,
Feb 11, 2025, 12:15:27 AM2/11/25
to syzbot, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, syzkall...@googlegroups.com, ch...@kernel.org

syzbot

unread,
Feb 11, 2025, 12:32:05 AM2/11/25
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in f2fs_handle_critical_error

kworker/u8:3: attempt to access beyond end of device
loop0: rw=2049, sector=40960, nr_sectors = 16 limit=40427
------------[ cut here ]------------
WARNING: CPU: 0 PID: 53 at fs/f2fs/super.c:4255 f2fs_handle_critical_error+0x34f/0x590 fs/f2fs/super.c:4255
Modules linked in:
CPU: 0 UID: 0 PID: 53 Comm: kworker/u8:3 Not tainted 6.14.0-rc1-syzkaller-00028-gb49923b8c6ce #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Workqueue: writeback wb_workfn (flush-7:0)
RIP: 0010:f2fs_handle_critical_error+0x34f/0x590 fs/f2fs/super.c:4255
Code: 48 83 e6 40 31 ff e8 00 10 a4 fd 48 83 e3 40 0f 84 30 02 00 00 e8 11 0b a4 fd 48 8b 5c 24 10 40 84 ed 74 1a e8 02 0b a4 fd 90 <0f> 0b 90 80 7c 24 08 00 74 30 e8 f2 0a a4 fd e9 83 00 00 00 e8 e8
RSP: 0018:ffffc90000bd6be0 EFLAGS: 00010293
RAX: ffffffff841b52be RBX: ffff88807df62000 RCX: ffff8880226fda00
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000002
RBP: 0000000000000003 R08: ffffffff841b521b R09: 1ffffffff2858d2c
R10: dffffc0000000000 R11: fffffbfff2858d2d R12: ffff8880551e596b
R13: dffffc0000000000 R14: ffff8880551e4000 R15: ffff8880551e5988
FS: 0000000000000000(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f490b243290 CR3: 0000000029b3e000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
f2fs_write_end_io+0x674/0x9a0 fs/f2fs/data.c:347
__submit_merged_bio+0x2a9/0x710 fs/f2fs/data.c:537
__f2fs_submit_merged_write fs/f2fs/data.c:633 [inline]
__submit_merged_write_cond fs/f2fs/data.c:655 [inline]
f2fs_submit_merged_write+0x1ea/0x2c0 fs/f2fs/data.c:665
f2fs_sync_node_pages+0x1a2c/0x1c90 fs/f2fs/node.c:2101
f2fs_write_node_pages+0x304/0x6d0 fs/f2fs/node.c:2173
do_writepages+0x35f/0x880 mm/page-writeback.c:2687
__writeback_single_inode+0x14f/0x10d0 fs/fs-writeback.c:1680
writeback_sb_inodes+0x820/0x1360 fs/fs-writeback.c:1976
wb_writeback+0x413/0xb80 fs/fs-writeback.c:2156
wb_do_writeback fs/fs-writeback.c:2303 [inline]
wb_workfn+0x410/0x1080 fs/fs-writeback.c:2343
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317
worker_thread+0x870/0xd30 kernel/workqueue.c:3398
kthread+0x7a9/0x920 kernel/kthread.c:464
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
</TASK>


Tested on:

commit: b49923b8 f2fs: fix to avoid panic once fallocation fai..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git bugfix/syzbot
console output: https://syzkaller.appspot.com/x/log.txt?x=14c2b1b0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=147b7d49d83b8036
dashboard link: https://syzkaller.appspot.com/bug?extid=15669ec8c35ddf6c3d43
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.

Chao Yu

unread,
Feb 11, 2025, 1:09:49 AM2/11/25
to syzbot, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, syzkall...@googlegroups.com, ch...@kernel.org
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git bugfix/syzbot

On 2/11/25 05:42, syzbot wrote:

syzbot

unread,
Feb 11, 2025, 1:35:05 AM2/11/25
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+15669e...@syzkaller.appspotmail.com
Tested-by: syzbot+15669e...@syzkaller.appspotmail.com

Tested on:

commit: b278ebc2 f2fs: fix to avoid panic once fallocation fai..
console output: https://syzkaller.appspot.com/x/log.txt?x=1191c3f8580000
kernel config: https://syzkaller.appspot.com/x/.config?x=147b7d49d83b8036
dashboard link: https://syzkaller.appspot.com/bug?extid=15669ec8c35ddf6c3d43
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Feb 11, 2025, 8:14:06 AM2/11/25
to ch...@kernel.org, ha...@vivo.com, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, syzkall...@googlegroups.com
syzbot has bisected this issue to:

commit 84b5bb8bf0f6a78c232a20c2eecdbb8112ac2703
Author: Qi Han <ha...@vivo.com>
Date: Fri Oct 25 09:18:23 2024 +0000

f2fs: modify f2fs_is_checkpoint_ready logic to allow more data to be written with the CP disable

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11d1f1b0580000
start commit: a64dcfb451e2 Linux 6.14-rc2
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=13d1f1b0580000
console output: https://syzkaller.appspot.com/x/log.txt?x=15d1f1b0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=4b1ef007dfb9422f
dashboard link: https://syzkaller.appspot.com/bug?extid=15669ec8c35ddf6c3d43
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=166931b0580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12be72a4580000

Reported-by: syzbot+15669e...@syzkaller.appspotmail.com
Fixes: 84b5bb8bf0f6 ("f2fs: modify f2fs_is_checkpoint_ready logic to allow more data to be written with the CP disable")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages