Re: [syzbot] [sound?] [mm?] kernel BUG in filemap_fault
From: syzbot
Date: Sun Apr 13 2025 - 12:40:30 EST
syzbot has found a reproducer for the following issue on:
HEAD commit: 7cdabafc0012 Merge tag 'trace-v6.15-rc1' of git://git.kern..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16632a3f980000
kernel config: https://syzkaller.appspot.com/x/.config?x=fb8650d88e9fb80f
dashboard link: https://syzkaller.appspot.com/bug?extid=f37372d86207b3bb2941
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=17eddc04580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11632a3f980000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ddfdb666520c/disk-7cdabafc.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/496b316616fe/vmlinux-7cdabafc.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6865907c6452/bzImage-7cdabafc.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f37372d86207b3bb2941@xxxxxxxxxxxxxxxxxxxxxxxxx
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1262 [inline]
free_unref_folios+0xdfd/0x17e0 mm/page_alloc.c:2737
folios_put_refs+0x70a/0x800 mm/swap.c:992
folio_batch_release include/linux/pagevec.h:101 [inline]
truncate_inode_pages_range+0x462/0x10e0 mm/truncate.c:379
truncate_bdev_range+0xcb/0x100 block/bdev.c:125
blkdev_fallocate+0x264/0x490 block/fops.c:857
vfs_fallocate+0x627/0x7a0 fs/open.c:338
madvise_remove mm/madvise.c:1034 [inline]
madvise_vma_behavior mm/madvise.c:1263 [inline]
madvise_walk_vmas mm/madvise.c:1530 [inline]
madvise_do_behavior+0x1eda/0x4640 mm/madvise.c:1695
do_madvise mm/madvise.c:1782 [inline]
__do_sys_madvise mm/madvise.c:1790 [inline]
__se_sys_madvise mm/madvise.c:1788 [inline]
__x64_sys_madvise+0x185/0x220 mm/madvise.c:1788
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
------------[ cut here ]------------
kernel BUG at mm/filemap.c:3432!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 5843 Comm: syz-executor394 Not tainted 6.15.0-rc1-syzkaller-00325-g7cdabafc0012 #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:filemap_fault+0x1360/0x13d0 mm/filemap.c:3432
Code: c4 ff 48 8b 3c 24 48 c7 c6 80 11 54 8c e8 e8 f9 0e 00 90 0f 0b e8 50 e9 c4 ff 48 89 df 48 c7 c6 00 0b 54 8c e8 d1 f9 0e 00 90 <0f> 0b e8 39 e9 c4 ff 48 8b 3c 24 48 c7 c6 80 11 54 8c e8 b9 f9 0e
RSP: 0018:ffffc90003fbf120 EFLAGS: 00010246
RAX: 63245e9776778400 RBX: ffffea0000d4b380 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8e4eaa0b RDI: ffffffff8ca0e120
RBP: ffffc90003fbf258 R08: ffffffff8236b186 R09: fffffbfff1d7a970
R10: dffffc0000000000 R11: fffffbfff1d7a970 R12: ffff888023ab1f78
R13: 1ffffd40001a9671 R14: dffffc0000000000 R15: ffffea0000d4b388
FS: 00007f116eb456c0(0000) GS:ffff888124fc9000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000001ea5 CR3: 000000003361e000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__do_fault+0x135/0x390 mm/memory.c:5098
do_read_fault mm/memory.c:5518 [inline]
do_fault mm/memory.c:5652 [inline]
do_pte_missing mm/memory.c:4160 [inline]
handle_pte_fault+0x3f0c/0x61c0 mm/memory.c:5997
__handle_mm_fault mm/memory.c:6140 [inline]
handle_mm_fault+0x1030/0x1aa0 mm/memory.c:6309
do_user_addr_fault arch/x86/mm/fault.c:1388 [inline]
handle_page_fault arch/x86/mm/fault.c:1480 [inline]
exc_page_fault+0x2bb/0x920 arch/x86/mm/fault.c:1538
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:rep_movs_alternative+0xf/0x90 arch/x86/lib/copy_user_64.S:46
Code: c4 10 c3 cc cc cc cc 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 48 83 f9 40 73 44 83 f9 08 73 25 85 c9 74 0f <8a> 06 88 07 48 ff c7 48 ff c6 48 ff c9 75 f1 c3 cc cc cc cc 66 2e
RSP: 0018:ffffc90003fbf930 EFLAGS: 00050202
RAX: 00007ffffffff001 RBX: 0000200000001ea5 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000200000001ea5 RDI: ffff88807f7eebe5
RBP: 0000000000000001 R08: ffff88807f7eebe5 R09: 1ffff1100fefdd7c
R10: dffffc0000000000 R11: ffffed100fefdd7d R12: ffff88807f7eebe5
R13: 1ffff11004c93307 R14: ffff88807f7eebe5 R15: 0000000000000001
copy_user_generic arch/x86/include/asm/uaccess_64.h:126 [inline]
raw_copy_from_user arch/x86/include/asm/uaccess_64.h:141 [inline]
_inline_copy_from_user include/linux/uaccess.h:178 [inline]
_copy_from_user+0x7b/0xb0 lib/usercopy.c:18
copy_from_user include/linux/uaccess.h:212 [inline]
snd_rawmidi_kernel_write1+0x390/0x620 sound/core/rawmidi.c:1560
snd_rawmidi_write+0x5f2/0xc00 sound/core/rawmidi.c:1629
do_loop_readv_writev fs/read_write.c:848 [inline]
vfs_writev+0x5ba/0xbc0 fs/read_write.c:1057
do_writev+0x1b8/0x360 fs/read_write.c:1101
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f116eb8f9b9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 18 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:00007f116eb45218 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007f116ec17328 RCX: 00007f116eb8f9b9
RDX: 0000000000000002 RSI: 0000200000000840 RDI: 0000000000000005
RBP: 00007f116ec17320 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f116ebe435c
R13: 0000200000000080 R14: 0000200000000000 R15: 6c756e2f7665642f
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:filemap_fault+0x1360/0x13d0 mm/filemap.c:3432
Code: c4 ff 48 8b 3c 24 48 c7 c6 80 11 54 8c e8 e8 f9 0e 00 90 0f 0b e8 50 e9 c4 ff 48 89 df 48 c7 c6 00 0b 54 8c e8 d1 f9 0e 00 90 <0f> 0b e8 39 e9 c4 ff 48 8b 3c 24 48 c7 c6 80 11 54 8c e8 b9 f9 0e
RSP: 0018:ffffc90003fbf120 EFLAGS: 00010246
RAX: 63245e9776778400 RBX: ffffea0000d4b380 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8e4eaa0b RDI: ffffffff8ca0e120
RBP: ffffc90003fbf258 R08: ffffffff8236b186 R09: fffffbfff1d7a970
R10: dffffc0000000000 R11: fffffbfff1d7a970 R12: ffff888023ab1f78
R13: 1ffffd40001a9671 R14: dffffc0000000000 R15: ffffea0000d4b388
FS: 00007f116eb456c0(0000) GS:ffff888124fc9000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000001ea5 CR3: 000000003361e000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 10 c3 adc %al,%bl
2: cc int3
3: cc int3
4: cc int3
5: cc int3
6: 0f 1f 40 00 nopl 0x0(%rax)
a: 90 nop
b: 90 nop
c: 90 nop
d: 90 nop
e: 90 nop
f: 90 nop
10: 90 nop
11: 90 nop
12: 90 nop
13: 90 nop
14: 90 nop
15: 90 nop
16: 90 nop
17: 90 nop
18: 90 nop
19: 90 nop
1a: 48 83 f9 40 cmp $0x40,%rcx
1e: 73 44 jae 0x64
20: 83 f9 08 cmp $0x8,%ecx
23: 73 25 jae 0x4a
25: 85 c9 test %ecx,%ecx
27: 74 0f je 0x38
* 29: 8a 06 mov (%rsi),%al <-- trapping instruction
2b: 88 07 mov %al,(%rdi)
2d: 48 ff c7 inc %rdi
30: 48 ff c6 inc %rsi
33: 48 ff c9 dec %rcx
36: 75 f1 jne 0x29
38: c3 ret
39: cc int3
3a: cc int3
3b: cc int3
3c: cc int3
3d: 66 data16
3e: 2e cs
---
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.