[syzbot] [kernel?] general protection fault in arch_tlbbatch_flush

From: syzbot
Date: Mon Jul 24 2023 - 02:23:23 EST


Hello,

syzbot found the following issue on:

HEAD commit: c58c49dd8932 Add linux-next specific files for 20230720
git tree: linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=16dc3a9ea80000
kernel config: https://syzkaller.appspot.com/x/.config?x=27d64413bce3a1d8
dashboard link: https://syzkaller.appspot.com/bug?extid=5759bce381cb6f9c51fa
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=177f484ea80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12e4a4e6a80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8e4bcbe4cabb/disk-c58c49dd.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f914705f688f/vmlinux-c58c49dd.xz
kernel image: https://storage.googleapis.com/syzbot-assets/dc19caf12e86/bzImage-c58c49dd.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+5759bce381cb6f9c51fa@xxxxxxxxxxxxxxxxxxxxxxxxx

general protection fault, probably for non-canonical address 0xdffffc00000000fe: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000007f0-0x00000000000007f7]
CPU: 1 PID: 31 Comm: kcompactd0 Not tainted 6.5.0-rc2-next-20230720-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023
RIP: 0010:mm_has_notifiers include/linux/mmu_notifier.h:282 [inline]
RIP: 0010:mmu_notifier_arch_invalidate_secondary_tlbs include/linux/mmu_notifier.h:489 [inline]
RIP: 0010:arch_tlbbatch_flush+0x3d8/0x560 arch/x86/mm/tlb.c:1268
Code: 03 80 3c 02 00 0f 85 f3 00 00 00 48 8b 9b 28 05 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d bb f0 07 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 c0 00 00 00 48 83 bb f0 07 00 00 00 75 62 48 83
RSP: 0018:ffffc90000a7f5d0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 00000000000000fe RSI: ffffffff813b2ae5 RDI: 00000000000007f0
RBP: 0000000000000001 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880b993bbc0
R13: 0000000000000001 R14: ffffc90000a7f8d8 R15: ffffea0000314b48
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd5da70d80 CR3: 000000002a6e2000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
try_to_unmap_flush+0x6b/0xf0 mm/rmap.c:621
migrate_pages_batch+0x2524/0x2c70 mm/migrate.c:1740
migrate_pages_sync mm/migrate.c:1822 [inline]
migrate_pages+0x1a01/0x2640 mm/migrate.c:1926
compact_zone+0x1cee/0x3f60 mm/compaction.c:2512
proactive_compact_node+0x118/0x1d0 mm/compaction.c:2777
kcompactd+0x710/0xd80 mm/compaction.c:3097
kthread+0x33a/0x430 kernel/kthread.c:389
ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:296
RIP: 0000:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 0000:0000000000000000 EFLAGS: 00000000 ORIG_RAX: 0000000000000000
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:mm_has_notifiers include/linux/mmu_notifier.h:282 [inline]
RIP: 0010:mmu_notifier_arch_invalidate_secondary_tlbs include/linux/mmu_notifier.h:489 [inline]
RIP: 0010:arch_tlbbatch_flush+0x3d8/0x560 arch/x86/mm/tlb.c:1268
Code: 03 80 3c 02 00 0f 85 f3 00 00 00 48 8b 9b 28 05 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d bb f0 07 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 c0 00 00 00 48 83 bb f0 07 00 00 00 75 62 48 83
RSP: 0018:ffffc90000a7f5d0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 00000000000000fe RSI: ffffffff813b2ae5 RDI: 00000000000007f0
RBP: 0000000000000001 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880b993bbc0
R13: 0000000000000001 R14: ffffc90000a7f8d8 R15: ffffea0000314b48
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 000000000c776000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
4: 0f 85 f3 00 00 00 jne 0xfd
a: 48 8b 9b 28 05 00 00 mov 0x528(%rbx),%rbx
11: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
18: fc ff df
1b: 48 8d bb f0 07 00 00 lea 0x7f0(%rbx),%rdi
22: 48 89 fa mov %rdi,%rdx
25: 48 c1 ea 03 shr $0x3,%rdx
* 29: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction
2d: 0f 85 c0 00 00 00 jne 0xf3
33: 48 83 bb f0 07 00 00 cmpq $0x0,0x7f0(%rbx)
3a: 00
3b: 75 62 jne 0x9f
3d: 48 rex.W
3e: 83 .byte 0x83


---
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 syzkaller@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

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.

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup