Hi,
We would like to report the following bug which has been found by our
modified version of syzkaller.
======================================================
description: kernel BUG in f2fs_new_node_page
affected file: fs/f2fs/node.c
kernel version: 5.19-rc6
kernel commit: 32346491ddf24599decca06190ebca03ff9de7f8
git tree: upstream
kernel config: https://syzkaller.appspot.com/text?tag=KernelConfig&x=cd73026ceaed1402
crash reproducer: attached
======================================================
Crash log:
======================================================
kernel BUG at fs/f2fs/node.c:1295!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 15331 Comm: syz-executor.5 Tainted: G OE
5.19.0-rc6-g2eae0556bb9d #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.13.0-1ubuntu1.1 04/01/2014
RIP: 0010:f2fs_new_node_page+0x19ac/0x1fc0 fs/f2fs/node.c:1295
Code: 14 02 48 89 c8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 03 06
00 00 03 ab 9c 0d 00 00 83 c5 01 e9 78 ea ff ff e8 54 71 d2 fd <0f> 0b
e8 4d 71 d2 fd 4c 89 e7 e8 55 64 54 fe e9 d5 f6 ff ff e8 3b
RSP: 0018:ffffc9000261f6b8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88812ce48000 RCX: ffff888155b7bb00
RDX: 0000000000000000 RSI: ffff888155b7bb00 RDI: 0000000000000002
RBP: 0000000000002002 R08: ffffffff83a85f6c R09: 0000000000000000
R10: 0000000000000005 R11: 000000000000000b R12: ffffffff8dbb40bc
R13: ffffea0005f1d6c0 R14: ffffc9000261f720 R15: ffff88812ce49390
FS: 00007fa403612700(0000) GS:ffff8881f5f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff76ba2f000 CR3: 00000001255c3000 CR4: 0000000000150ee0
Call Trace:
<TASK>
write_all_xattrs fs/f2fs/xattr.c:487 [inline]
__f2fs_setxattr+0xe76/0x2e10 fs/f2fs/xattr.c:743
f2fs_setxattr+0x233/0xab0 fs/f2fs/xattr.c:790
f2fs_xattr_generic_set+0x133/0x170 fs/f2fs/xattr.c:86
__vfs_setxattr+0x115/0x180 fs/xattr.c:182
__vfs_setxattr_noperm+0x125/0x5f0 fs/xattr.c:216
__vfs_setxattr_locked+0x1cf/0x260 fs/xattr.c:277
vfs_setxattr+0x13f/0x330 fs/xattr.c:303
setxattr+0x146/0x160 fs/xattr.c:611
path_setxattr+0x1a7/0x1d0 fs/xattr.c:630
__do_sys_lsetxattr fs/xattr.c:653 [inline]
__se_sys_lsetxattr fs/xattr.c:649 [inline]
__x64_sys_lsetxattr+0xbd/0x150 fs/xattr.c:649
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7fa404e8d4ed
Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 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:00007fa403611be8 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd
RAX: ffffffffffffffda RBX: 00007fa404fabf60 RCX: 00007fa404e8d4ed
RDX: 0000000020000480 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007fa404ef92e1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000039 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd4aa78f7f R14: 00007fa404fabf60 R15: 00007fa403611d80
</TASK>
Modules linked in: uio_ivshmem(OE) uio(E)
---[ end trace 0000000000000000 ]---
RIP: 0010:f2fs_new_node_page+0x19ac/0x1fc0 fs/f2fs/node.c:1295
Code: 14 02 48 89 c8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 03 06
00 00 03 ab 9c 0d 00 00 83 c5 01 e9 78 ea ff ff e8 54 71 d2 fd <0f> 0b
e8 4d 71 d2 fd 4c 89 e7 e8 55 64 54 fe e9 d5 f6 ff ff e8 3b
RSP: 0018:ffffc9000261f6b8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88812ce48000 RCX: ffff888155b7bb00
RDX: 0000000000000000 RSI: ffff888155b7bb00 RDI: 0000000000000002
RBP: 0000000000002002 R08: ffffffff83a85f6c R09: 0000000000000000
R10: 0000000000000005 R11: 000000000000000b R12: ffffffff8dbb40bc
R13: ffffea0005f1d6c0 R14: ffffc9000261f720 R15: ffff88812ce49390
FS: 00007fa403612700(0000) GS:ffff8881f5f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff76ba44000 CR3: 00000001255c3000 CR4: 0000000000150ee0
--
Thanks and Regards,
Dipanjan