Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel BUG in hpage_collapse_scan_file
------------[ cut here ]------------
kernel BUG at mm/khugepaged.c:1823!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5778 Comm: syz-executor.2 Not tainted 6.3.0-rc4-syzkaller-00025-g3a93e40326c8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
RIP: 0010:collapse_file mm/khugepaged.c:1823 [inline]
RIP: 0010:hpage_collapse_scan_file+0x65e5/0x7330 mm/khugepaged.c:2233
Code: 00 00 89 de e8 5c 27 a4 ff 31 ff 89 de e8 53 27 a4 ff 45 84 f6 0f 85 08 0d 00 00 e8 b5 24 a4 ff e9 9f f9 ff ff e8 ab 24 a4 ff <0f> 0b f3 0f 1e fa e8 a0 24 a4 ff e9 e1 f8 ff ff f3 0f 1e fa 4c 89
RSP: 0018:ffffc9000a62f4e0 EFLAGS: 00010093
RAX: ffffffff81e62e45 RBX: 00000000000001c1 RCX: ffff88802720d7c0
RDX: 0000000000000000 RSI: 00000000000001c0 RDI: 00000000000001c1
RBP: ffffc9000a62f830 R08: ffffffff81e5e4ec R09: fffffbfff1a02bab
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc9000a62f700
R13: 0000000000000000 R14: 00000000000001c0 R15: 00000000000001ff
FS: 00007f323fffe700(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3240da8000 CR3: 000000006c945000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
madvise_collapse+0x721/0xf50 mm/khugepaged.c:2693
madvise_vma_behavior mm/madvise.c:1086 [inline]
madvise_walk_vmas mm/madvise.c:1260 [inline]
do_madvise+0x9e5/0x4680 mm/madvise.c:1439
__do_sys_madvise mm/madvise.c:1452 [inline]
__se_sys_madvise mm/madvise.c:1450 [inline]
__x64_sys_madvise+0xa5/0xb0 mm/madvise.c:1450
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f3240c8c0f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007f323fffe168 EFLAGS: 00000246 ORIG_RAX: 000000000000001c
RAX: ffffffffffffffda RBX: 00007f3240dac050 RCX: 00007f3240c8c0f9
RDX: 0000000000000019 RSI: 000000000060005f RDI: 0000000020000000
RBP: 00007f323fffe1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffdd9b6ec9f R14: 00007f323fffe300 R15: 0000000000022000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:collapse_file mm/khugepaged.c:1823 [inline]
RIP: 0010:hpage_collapse_scan_file+0x65e5/0x7330 mm/khugepaged.c:2233
Code: 00 00 89 de e8 5c 27 a4 ff 31 ff 89 de e8 53 27 a4 ff 45 84 f6 0f 85 08 0d 00 00 e8 b5 24 a4 ff e9 9f f9 ff ff e8 ab 24 a4 ff <0f> 0b f3 0f 1e fa e8 a0 24 a4 ff e9 e1 f8 ff ff f3 0f 1e fa 4c 89
RSP: 0018:ffffc9000a62f4e0 EFLAGS: 00010093
RAX: ffffffff81e62e45 RBX: 00000000000001c1 RCX: ffff88802720d7c0
RDX: 0000000000000000 RSI: 00000000000001c0 RDI: 00000000000001c1
RBP: ffffc9000a62f830 R08: ffffffff81e5e4ec R09: fffffbfff1a02bab
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc9000a62f700
R13: 0000000000000000 R14: 00000000000001c0 R15: 00000000000001ff
FS: 00007f323fffe700(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3240da8000 CR3: 000000006c945000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Tested on:
commit: 3a93e403 Merge tag 'for-linus' of git://
git.kernel.org..
git tree: upstream
console output:
https://syzkaller.appspot.com/x/log.txt?x=172bec9ec80000
kernel config:
https://syzkaller.appspot.com/x/.config?x=9c35b3803e5ad668
dashboard link:
https://syzkaller.appspot.com/bug?extid=9578faa5475acb35fa50
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
Note: no patches were applied.