[v6.1] kernel BUG in f2fs_vm_page_mkwrite

0 views
Skip to first unread message

syzbot

unread,
Jun 2, 2024, 6:20:30 PMJun 2
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 88690811da69 Linux 6.1.92
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16899b9a980000
kernel config: https://syzkaller.appspot.com/x/.config?x=ee57a613e7f5bf6c
dashboard link: https://syzkaller.appspot.com/bug?extid=08e9f16eafbb8233ddcc
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: https://storage.googleapis.com/syzbot-assets/8b45ba80e02a/disk-88690811.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ca769d644800/vmlinux-88690811.xz
kernel image: https://storage.googleapis.com/syzbot-assets/26a1d8aecbf6/bzImage-88690811.xz

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

------------[ cut here ]------------
kernel BUG at fs/f2fs/file.c:101!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 5933 Comm: syz-executor.2 Not tainted 6.1.92-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:f2fs_vm_page_mkwrite+0xf42/0x1410 fs/f2fs/file.c:101
Code: fe e9 a6 f4 ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 07 fb ff ff e8 cd 57 20 fe e9 fd fa ff ff e8 13 53 c9 06 e8 4e d8 c8 fd <0f> 0b e8 47 d8 c8 fd 4c 89 ff 48 c7 c6 a0 73 31 8b e8 48 89 08 fe
RSP: 0018:ffffc900067277c0 EFLAGS: 00010287
RAX: ffffffff83c1b502 RBX: 0000000000000400 RCX: 0000000000040000
RDX: ffffc90003201000 RSI: 0000000000000841 RDI: 0000000000000842
RBP: ffffc90006727908 R08: ffffffff83c1aa71 R09: ffffed100aae9a93
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90006727b70
R13: 0000000020010601 R14: 0000000020010602 R15: ffff88805574d490
FS: 00007f9938fd26c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2fd22000 CR3: 000000006002c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:2992
wp_page_shared+0x164/0x380 mm/memory.c:3341
handle_pte_fault mm/memory.c:5031 [inline]
__handle_mm_fault mm/memory.c:5155 [inline]
handle_mm_fault+0x2525/0x5340 mm/memory.c:5276
do_user_addr_fault arch/x86/mm/fault.c:1371 [inline]
handle_page_fault arch/x86/mm/fault.c:1462 [inline]
exc_page_fault+0x26f/0x660 arch/x86/mm/fault.c:1518
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0010:copy_user_short_string+0xd/0x40 arch/x86/lib/copy_user_64.S:233
Code: 74 0a 89 d1 f3 a4 89 c8 0f 01 ca c3 89 d0 0f 01 ca c3 01 ca eb e7 0f 1f 80 00 00 00 00 89 d1 83 e2 07 c1 e9 03 74 12 4c 8b 06 <4c> 89 07 48 8d 76 08 48 8d 7f 08 ff c9 75 ee 21 d2 74 10 89 d1 8a
RSP: 0018:ffffc90006727d70 EFLAGS: 00050202
RAX: ffffffff84385601 RBX: 00007fffffffeff0 RCX: 0000000000000002
RDX: 0000000000000000 RSI: ffffc90006727de0 RDI: 0000000020000280
RBP: ffffc90006727e50 R08: 00000000665cf021 R09: fffff52000ce4fbe
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000010
R13: dffffc0000000000 R14: 0000000020000280 R15: ffffc90006727de0
copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline]
raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline]
_copy_to_user+0xe9/0x130 lib/usercopy.c:41
copy_to_user include/linux/uaccess.h:169 [inline]
put_timespec64+0xf6/0x150 kernel/time/time.c:812
__do_sys_clock_gettime kernel/time/posix-timers.c:1134 [inline]
__se_sys_clock_gettime kernel/time/posix-timers.c:1122 [inline]
__x64_sys_clock_gettime+0x1cd/0x220 kernel/time/posix-timers.c:1122
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f993827cee9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f9938fd20c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e4
RAX: ffffffffffffffda RBX: 00007f99383b3fa0 RCX: 00007f993827cee9
RDX: 0000000000000000 RSI: 0000000020000280 RDI: 0000000000000000
RBP: 00007f99382c947f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f99383b3fa0 R15: 00007ffc03175408
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:f2fs_vm_page_mkwrite+0xf42/0x1410 fs/f2fs/file.c:101
Code: fe e9 a6 f4 ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 07 fb ff ff e8 cd 57 20 fe e9 fd fa ff ff e8 13 53 c9 06 e8 4e d8 c8 fd <0f> 0b e8 47 d8 c8 fd 4c 89 ff 48 c7 c6 a0 73 31 8b e8 48 89 08 fe
RSP: 0018:ffffc900067277c0 EFLAGS: 00010287
RAX: ffffffff83c1b502 RBX: 0000000000000400 RCX: 0000000000040000
RDX: ffffc90003201000 RSI: 0000000000000841 RDI: 0000000000000842
RBP: ffffc90006727908 R08: ffffffff83c1aa71 R09: ffffed100aae9a93
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90006727b70
R13: 0000000020010601 R14: 0000000020010602 R15: ffff88805574d490
FS: 00007f9938fd26c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f01bed4019c CR3: 000000006002c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 74 0a je 0xc
2: 89 d1 mov %edx,%ecx
4: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi)
6: 89 c8 mov %ecx,%eax
8: 0f 01 ca clac
b: c3 ret
c: 89 d0 mov %edx,%eax
e: 0f 01 ca clac
11: c3 ret
12: 01 ca add %ecx,%edx
14: eb e7 jmp 0xfffffffd
16: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
1d: 89 d1 mov %edx,%ecx
1f: 83 e2 07 and $0x7,%edx
22: c1 e9 03 shr $0x3,%ecx
25: 74 12 je 0x39
27: 4c 8b 06 mov (%rsi),%r8
* 2a: 4c 89 07 mov %r8,(%rdi) <-- trapping instruction
2d: 48 8d 76 08 lea 0x8(%rsi),%rsi
31: 48 8d 7f 08 lea 0x8(%rdi),%rdi
35: ff c9 dec %ecx
37: 75 ee jne 0x27
39: 21 d2 and %edx,%edx
3b: 74 10 je 0x4d
3d: 89 d1 mov %edx,%ecx
3f: 8a .byte 0x8a


---
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,
Jun 2, 2024, 6:21:21 PMJun 2
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c61bd26ae81a Linux 5.15.160
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=164c1564980000
kernel config: https://syzkaller.appspot.com/x/.config?x=235f0e81ca937c17
dashboard link: https://syzkaller.appspot.com/bug?extid=88c1945b19a968740c40
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: https://storage.googleapis.com/syzbot-assets/d61a97eef8b9/disk-c61bd26a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ab4908b4b59b/vmlinux-c61bd26a.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d818fd46802b/bzImage-c61bd26a.xz

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

F2FS-fs (loop4): Mounted with checkpoint version = 48b305e5
------------[ cut here ]------------
kernel BUG at fs/f2fs/file.c:100!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 3778 Comm: syz-executor.4 Not tainted 5.15.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:f2fs_vm_page_mkwrite+0xdd6/0xe20 fs/f2fs/file.c:100
Code: fe e9 db f5 ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 44 fb ff ff e8 b9 20 34 fe e9 3a fb ff ff e8 8f e3 87 06 e8 aa 52 ea fd <0f> 0b 48 85 db 75 0b e8 9e 52 ea fd 4c 8b 2c 24 eb 08 e8 93 52 ea
RSP: 0018:ffffc900031b77a0 EFLAGS: 00010287
RAX: ffffffff83960a16 RBX: 0000000000000400 RCX: 0000000000040000
RDX: ffffc90003299000 RSI: 0000000000000f87 RDI: 0000000000000f88
RBP: ffffc900031b78e0 R08: ffffffff839600ba R09: ffffed100bae6b47
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea0001f94dc0
R13: 0000000200100601 R14: 1ffff92000636f00 R15: 0000000200100602
FS: 00007f27acd5a6c0(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000280 CR3: 0000000076ebe000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892
wp_page_shared+0x179/0x690 mm/memory.c:3229
handle_pte_fault mm/memory.c:4639 [inline]
__handle_mm_fault mm/memory.c:4756 [inline]
handle_mm_fault+0x2a3d/0x5950 mm/memory.c:4854

syzbot

unread,
Jun 2, 2024, 6:41:23 PMJun 2
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: c61bd26ae81a Linux 5.15.160
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13bb8362980000
kernel config: https://syzkaller.appspot.com/x/.config?x=235f0e81ca937c17
dashboard link: https://syzkaller.appspot.com/bug?extid=88c1945b19a968740c40
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=125c094a980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16c9e432980000
mounted in repro: https://storage.googleapis.com/syzbot-assets/93885bdc29f7/mount_0.gz

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

loop0: detected capacity change from 0 to 40427
F2FS-fs (loop0): Found nat_bits in checkpoint
F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5
------------[ cut here ]------------
kernel BUG at fs/f2fs/file.c:100!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 3499 Comm: syz-executor137 Not tainted 5.15.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:f2fs_vm_page_mkwrite+0xdd6/0xe20 fs/f2fs/file.c:100
Code: fe e9 db f5 ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 44 fb ff ff e8 b9 20 34 fe e9 3a fb ff ff e8 8f e3 87 06 e8 aa 52 ea fd <0f> 0b 48 85 db 75 0b e8 9e 52 ea fd 4c 8b 2c 24 eb 08 e8 93 52 ea
RSP: 0018:ffffc90002df77a0 EFLAGS: 00010293
RAX: ffffffff83960a16 RBX: 0000000000000400 RCX: ffff888015fd0000
RDX: 0000000000000000 RSI: 0000000000000400 RDI: 0000000000000000
RBP: ffffc90002df78e0 R08: ffffffff839600ba R09: ffffed100e70c1c7
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea00007749c0
R13: 0000000200100601 R14: 1ffff920005bef00 R15: 0000000200100602
FS: 00005555564e3380(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055acb960d160 CR3: 0000000073270000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892
wp_page_shared+0x179/0x690 mm/memory.c:3229
handle_pte_fault mm/memory.c:4639 [inline]
__handle_mm_fault mm/memory.c:4756 [inline]
handle_mm_fault+0x2a3d/0x5950 mm/memory.c:4854
do_user_addr_fault arch/x86/mm/fault.c:1388 [inline]
handle_page_fault arch/x86/mm/fault.c:1476 [inline]
exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1532
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0010:copy_user_generic_unrolled+0x89/0xc0 arch/x86/lib/copy_user_64.S:92
Code: 38 4c 89 47 20 4c 89 4f 28 4c 89 57 30 4c 89 5f 38 48 8d 76 40 48 8d 7f 40 ff c9 75 b6 89 d1 83 e2 07 c1 e9 03 74 12 4c 8b 06 <4c> 89 07 48 8d 76 08 48 8d 7f 08 ff c9 75 ee 21 d2 74 10 89 d1 8a
RSP: 0018:ffffc90002df7d68 EFLAGS: 00050202
RAX: ffffffff8408dc01 RBX: 0000000020000290 RCX: 0000000000000002
RDX: 0000000000000000 RSI: ffffc90002df7de0 RDI: 0000000020000280
RBP: ffffc90002df7e50 R08: 00000000665cf471 R09: fffff520005befbe
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000010
R13: 00007ffffffff000 R14: ffffc90002df7de0 R15: 0000000020000280
copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline]
raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline]
_copy_to_user+0xef/0x130 lib/usercopy.c:40
copy_to_user include/linux/uaccess.h:200 [inline]
put_timespec64+0xf6/0x150 kernel/time/time.c:812
__do_sys_clock_gettime kernel/time/posix-timers.c:1139 [inline]
__se_sys_clock_gettime kernel/time/posix-timers.c:1127 [inline]
__x64_sys_clock_gettime+0x1cd/0x220 kernel/time/posix-timers.c:1127
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fa78bd1c7b9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 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:00007fff9e2828f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e4
RAX: ffffffffffffffda RBX: 00007fff9e282ad8 RCX: 00007fa78bd1c7b9
RDX: 00007fa78bd1c7b9 RSI: 0000000020000280 RDI: 0000000000000000
RBP: 00007fa78bd94610 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff9e282ac8 R14: 0000000000000001 R15: 0000000000000001
</TASK>
Modules linked in:
---[ end trace 63d32fbbf63079ba ]---
RIP: 0010:f2fs_vm_page_mkwrite+0xdd6/0xe20 fs/f2fs/file.c:100
Code: fe e9 db f5 ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 44 fb ff ff e8 b9 20 34 fe e9 3a fb ff ff e8 8f e3 87 06 e8 aa 52 ea fd <0f> 0b 48 85 db 75 0b e8 9e 52 ea fd 4c 8b 2c 24 eb 08 e8 93 52 ea
RSP: 0018:ffffc90002df77a0 EFLAGS: 00010293
RAX: ffffffff83960a16 RBX: 0000000000000400 RCX: ffff888015fd0000
RDX: 0000000000000000 RSI: 0000000000000400 RDI: 0000000000000000
RBP: ffffc90002df78e0 R08: ffffffff839600ba R09: ffffed100e70c1c7
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea00007749c0
R13: 0000000200100601 R14: 1ffff920005bef00 R15: 0000000200100602
FS: 00005555564e3380(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055acb960d160 CR3: 0000000073270000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 38 4c 89 47 cmp %cl,0x47(%rcx,%rcx,4)
4: 20 4c 89 4f and %cl,0x4f(%rcx,%rcx,4)
8: 28 4c 89 57 sub %cl,0x57(%rcx,%rcx,4)
c: 30 4c 89 5f xor %cl,0x5f(%rcx,%rcx,4)
10: 38 48 8d cmp %cl,-0x73(%rax)
13: 76 40 jbe 0x55
15: 48 8d 7f 40 lea 0x40(%rdi),%rdi
19: ff c9 dec %ecx
1b: 75 b6 jne 0xffffffd3
1d: 89 d1 mov %edx,%ecx
1f: 83 e2 07 and $0x7,%edx
22: c1 e9 03 shr $0x3,%ecx
25: 74 12 je 0x39
27: 4c 8b 06 mov (%rsi),%r8
* 2a: 4c 89 07 mov %r8,(%rdi) <-- trapping instruction
2d: 48 8d 76 08 lea 0x8(%rsi),%rsi
31: 48 8d 7f 08 lea 0x8(%rdi),%rdi
35: ff c9 dec %ecx
37: 75 ee jne 0x27
39: 21 d2 and %edx,%edx
3b: 74 10 je 0x4d
3d: 89 d1 mov %edx,%ecx
3f: 8a .byte 0x8a


---
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.
Reply all
Reply to author
Forward
0 new messages