Re: kernel BUG in hpage_collapse_scan_file

3 views
Skip to first unread message

Ivan Orlov

unread,
Mar 27, 2023, 5:29:23 PM3/27/23
to syzbot+9578fa...@syzkaller.appspotmail.com, syzkall...@googlegroups.com

syzbot

unread,
Mar 27, 2023, 6:40:32 PM3/27/23
to ivan.or...@gmail.com, syzkall...@googlegroups.com
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.

Ivan Orlov

unread,
Mar 28, 2023, 1:43:09 PM3/28/23
to syzbot+9578fa...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
0001-Test.patch

syzbot

unread,
Mar 28, 2023, 1:58:29 PM3/28/23
to ivan.or...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in shmem_evict_inode

------------[ cut here ]------------
WARNING: CPU: 1 PID: 5820 at mm/shmem.c:1178 shmem_evict_inode+0x9af/0x9f0
Modules linked in:
CPU: 1 PID: 5820 Comm: syz-executor.0 Not tainted 6.3.0-rc4-syzkaller-00025-g3a93e40326c8-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
RIP: 0010:shmem_evict_inode+0x9af/0x9f0 mm/shmem.c:1178
Code: 00 00 48 3b 84 24 e0 00 00 00 75 4b 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 eb 5a c6 ff e9 94 fe ff ff e8 e1 5a c6 ff <0f> 0b e9 d2 fe ff ff 48 c7 c1 00 0f fe 8c 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc900061ef6c0 EFLAGS: 00010293
RAX: ffffffff81c3f80f RBX: 0000000000000008 RCX: ffff88801ef6d7c0
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000000
RBP: ffffc900061ef7e8 R08: ffffffff81c3f6da R09: fffff52000c3dec9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff888029891998
R13: 0000000064232a73 R14: ffff888029891a58 R15: ffff888029891a80
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8b46cef378 CR3: 00000000711b4000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
evict+0x2a4/0x620 fs/inode.c:665
__dentry_kill+0x436/0x650 fs/dcache.c:607
dentry_kill+0xbb/0x290
dput+0x1f3/0x420 fs/dcache.c:913
__fput+0x5e4/0x890 fs/file_table.c:329
task_work_run+0x24a/0x300 kernel/task_work.c:179
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x68f/0x2290 kernel/exit.c:869
do_group_exit+0x206/0x2c0 kernel/exit.c:1019
get_signal+0x1701/0x17e0 kernel/signal.c:2859
arch_do_signal_or_restart+0x91/0x670 arch/x86/kernel/signal.c:306
exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:297
do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fd13308c0f9
Code: Unable to access opcode bytes at 0x7fd13308c0cf.
RSP: 002b:00007fd133e38218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007fd1331abf88 RCX: 00007fd13308c0f9
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fd1331abf88
RBP: 00007fd1331abf80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd1331abf8c
R13: 00007fffc253575f R14: 00007fd133e38300 R15: 0000000000022000
</TASK>


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=14180c0dc80000
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
patch: https://syzkaller.appspot.com/x/patch.diff?x=1328d7c1c80000

Ivan Orlov

unread,
Mar 28, 2023, 3:15:17 PM3/28/23
to syzbot+9578fa...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
0001-Test.patch

syzbot

unread,
Mar 28, 2023, 3:38:25 PM3/28/23
to ivan.or...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+9578fa...@syzkaller.appspotmail.com

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=130f8b25c80000
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
patch: https://syzkaller.appspot.com/x/patch.diff?x=126bdfdec80000

Note: testing is done by a robot and is best-effort only.

Ivan Orlov

unread,
Mar 28, 2023, 4:18:49 PM3/28/23
to syzbot+9578fa...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
0001-Test.patch

syzbot

unread,
Mar 28, 2023, 4:42:28 PM3/28/23
to ivan.or...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+9578fa...@syzkaller.appspotmail.com

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=142d4771c80000
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
patch: https://syzkaller.appspot.com/x/patch.diff?x=11d444b9c80000

Ivan Orlov

unread,
Mar 29, 2023, 10:21:06 AM3/29/23
to syzbot+9578fa...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
0001-mm-khugepaged-Fix-kernel-BUG-in-hpage_collapse_scan_.patch

syzbot

unread,
Mar 29, 2023, 10:45:28 AM3/29/23
to ivan.or...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+9578fa...@syzkaller.appspotmail.com

Tested on:

commit: fcd476ea Merge tag 'urgent-rcu.2023.03.28a' of git://g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=136dd349c80000
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
patch: https://syzkaller.appspot.com/x/patch.diff?x=120032cdc80000

Ivan Orlov

unread,
Mar 30, 2023, 11:12:09 AM3/30/23
to syzbot+9578fa...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
v2-0001-mm-khugepaged-Fix-kernel-BUG-in-hpage_collapse_sc.patch

syzbot

unread,
Mar 30, 2023, 11:39:23 AM3/30/23
to ivan.or...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+9578fa...@syzkaller.appspotmail.com

Tested on:

commit: ffe78bbd Merge tag 'xtensa-20230327' of https://github..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1012965dc80000
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
patch: https://syzkaller.appspot.com/x/patch.diff?x=1491af15c80000
Reply all
Reply to author
Forward
0 new messages