syzbot


kernel BUG in f2fs_invalidate_blocks

Status: upstream: reported on 2024/09/17 08:41
Subsystems: f2fs
[Documentation on labels]
Reported-by: syzbot+33379ce4ac76acf7d0c7@syzkaller.appspotmail.com
Fix commit: 6babe00ccd34 f2fs: fix to do sanity check on node blkaddr in truncate_node()
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu-native-arm64-kvm ci-qemu2-arm32]
First crash: 90d, last: 73d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] f2fs: fix to do sanity check on node blkaddr in truncate_node() 2 (2) 2024/10/28 17:40
[syzbot] [f2fs?] kernel BUG in f2fs_invalidate_blocks 0 (1) 2024/09/17 08:41

Sample crash report:
loop0: detected capacity change from 0 to 40427
F2FS-fs (loop0): Invalid log_blocksize (268), supports only 12
F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
F2FS-fs (loop0): Found nat_bits in checkpoint
F2FS-fs (loop0): Try to recover 1th superblock, ret: 0
F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5
F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=1, run fsck to fix.
F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=2, run fsck to fix.
------------[ cut here ]------------
kernel BUG at fs/f2fs/segment.c:2534!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5111 Comm: syz.0.0 Not tainted 6.12.0-rc1-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:f2fs_invalidate_blocks+0x35f/0x370 fs/f2fs/segment.c:2534
Code: 53 fc fd e9 7f fe ff ff e8 4e a2 92 fd 44 89 ee 48 c7 c7 60 34 f2 8e 48 89 da e8 fc 29 f2 00 e9 fb fd ff ff e8 32 a2 92 fd 90 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 90 90 90 90 90
RSP: 0018:ffffc90002def300 EFLAGS: 00010283
RAX: ffffffff8402397e RBX: 0000000000000000 RCX: 0000000000040000
RDX: ffffc9000b422000 RSI: 000000000002bc6f RDI: 000000000002bc70
RBP: 0000000000000000 R08: 0000000000000005 R09: ffffffff840237ee
R10: 0000000000000003 R11: ffff88801f928000 R12: ffffc90002def3c0
R13: 00000000ffffffff R14: ffff888040598000 R15: 0000000000000000
FS:  00007ff01aad56c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f00cc8b840c CR3: 000000003f74e000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 truncate_node+0x1ae/0x8c0 fs/f2fs/node.c:909
 f2fs_remove_inode_page+0x5c2/0x870 fs/f2fs/node.c:1288
 f2fs_evict_inode+0x879/0x15c0 fs/f2fs/inode.c:856
 evict+0x4e8/0x9b0 fs/inode.c:723
 f2fs_handle_failed_inode+0x271/0x2e0 fs/f2fs/inode.c:986
 f2fs_create+0x357/0x530 fs/f2fs/namei.c:394
 lookup_open fs/namei.c:3595 [inline]
 open_last_lookups fs/namei.c:3694 [inline]
 path_openat+0x1c03/0x3590 fs/namei.c:3930
 do_filp_open+0x235/0x490 fs/namei.c:3960
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1415
 do_sys_open fs/open.c:1430 [inline]
 __do_sys_openat fs/open.c:1446 [inline]
 __se_sys_openat fs/open.c:1441 [inline]
 __x64_sys_openat+0x247/0x2a0 fs/open.c:1441
 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:0x7ff019d7dff9
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:00007ff01aad5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007ff019f35f80 RCX: 00007ff019d7dff9
RDX: 000000000000275a RSI: 0000000020000600 RDI: ffffffffffffff9c
RBP: 00007ff019df0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff019f35f80 R15: 00007ffe1483b4f8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:f2fs_invalidate_blocks+0x35f/0x370 fs/f2fs/segment.c:2534
Code: 53 fc fd e9 7f fe ff ff e8 4e a2 92 fd 44 89 ee 48 c7 c7 60 34 f2 8e 48 89 da e8 fc 29 f2 00 e9 fb fd ff ff e8 32 a2 92 fd 90 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 90 90 90 90 90
RSP: 0018:ffffc90002def300 EFLAGS: 00010283
RAX: ffffffff8402397e RBX: 0000000000000000 RCX: 0000000000040000
RDX: ffffc9000b422000 RSI: 000000000002bc6f RDI: 000000000002bc70
RBP: 0000000000000000 R08: 0000000000000005 R09: ffffffff840237ee
R10: 0000000000000003 R11: ffff88801f928000 R12: ffffc90002def3c0
R13: 00000000ffffffff R14: ffff888040598000 R15: 0000000000000000
FS:  00007ff01aad56c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f00cc8b840c CR3: 000000003f74e000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/30 14:45 upstream 9852d85ec9d4 179f4029 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in f2fs_invalidate_blocks
2024/09/13 08:37 upstream 196145c606d0 73e8a465 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in f2fs_invalidate_blocks
* Struck through repros no longer work on HEAD.