syzbot


general protection fault in sys_mremap

Status: upstream: reported C repro on 2025/04/02 00:00
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+e3385f43b2897a19be24@syzkaller.appspotmail.com
Fix commit: mm/mremap: do not set vrm->vma NULL immediately prior to checking it
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 5d16h, last: 17h06m
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [mm?] general protection fault in sys_mremap 5 (10) 2025/04/02 22:31
Last patch testing requests (2)
Created Duration User Patch Repo Result
2025/04/02 11:49 56m lorenzo.stoakes@oracle.com https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/ mm-stable report log
2025/04/02 10:22 1h00m lorenzo.stoakes@oracle.com https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/ mm-stable report log

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000004: 0000 [#1] SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027]
CPU: 1 UID: 0 PID: 5827 Comm: syz-executor187 Not tainted 6.14.0-syzkaller-12456-gacc4d5ff0b61 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:vrm_uncharge mm/mremap.c:964 [inline]
RIP: 0010:expand_vma_in_place mm/mremap.c:1566 [inline]
RIP: 0010:expand_vma mm/mremap.c:1621 [inline]
RIP: 0010:mremap_at mm/mremap.c:1682 [inline]
RIP: 0010:do_mremap mm/mremap.c:1727 [inline]
RIP: 0010:__do_sys_mremap mm/mremap.c:1784 [inline]
RIP: 0010:__se_sys_mremap+0x25fa/0x2c00 mm/mremap.c:1752
Code: c0 0f 85 0e 05 00 00 0f b6 9c 24 20 03 00 00 31 ff 89 de e8 68 9c ad ff 85 db 0f 84 7b 01 00 00 e8 5b 99 ad ff e9 9e 00 00 00 <80> 78 04 00 74 0a bf 20 00 00 00 e8 46 2d 15 00 4c 8b 34 25 20 00
RSP: 0018:ffffc9000414fb40 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 1ffff92000829fca
RDX: 0000000000000000 RSI: 0000000010000000 RDI: 0000000000000000
RBP: ffffc9000414ff00 R08: ffffffff821a7ea4 R09: ffffffff8c1f2397
R10: 0000000000000004 R11: ffff888030613c00 R12: 0000200000000000
R13: ffff888077690780 R14: 00000000180000fa R15: ffffc9000414fcd0
FS:  000055555d82a380(0000) GS:ffff8881250cf000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000000c0 CR3: 0000000034a4a000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 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:0x7f56a8c90369
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 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:00007ffc63c1c6c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000019
RAX: ffffffffffffffda RBX: 0000200000000000 RCX: 00007f56a8c90369
RDX: 0000000000004000 RSI: 0000000000001000 RDI: 0000200000000000
RBP: 0000200000001000 R08: 0000200000001000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc63c1c8a8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:vrm_uncharge mm/mremap.c:964 [inline]
RIP: 0010:expand_vma_in_place mm/mremap.c:1566 [inline]
RIP: 0010:expand_vma mm/mremap.c:1621 [inline]
RIP: 0010:mremap_at mm/mremap.c:1682 [inline]
RIP: 0010:do_mremap mm/mremap.c:1727 [inline]
RIP: 0010:__do_sys_mremap mm/mremap.c:1784 [inline]
RIP: 0010:__se_sys_mremap+0x25fa/0x2c00 mm/mremap.c:1752
Code: c0 0f 85 0e 05 00 00 0f b6 9c 24 20 03 00 00 31 ff 89 de e8 68 9c ad ff 85 db 0f 84 7b 01 00 00 e8 5b 99 ad ff e9 9e 00 00 00 <80> 78 04 00 74 0a bf 20 00 00 00 e8 46 2d 15 00 4c 8b 34 25 20 00
RSP: 0018:ffffc9000414fb40 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 1ffff92000829fca
RDX: 0000000000000000 RSI: 0000000010000000 RDI: 0000000000000000
RBP: ffffc9000414ff00 R08: ffffffff821a7ea4 R09: ffffffff8c1f2397
R10: 0000000000000004 R11: ffff888030613c00 R12: 0000200000000000
R13: ffff888077690780 R14: 00000000180000fa R15: ffffc9000414fcd0
FS:  000055555d82a380(0000) GS:ffff8881250cf000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000000c0 CR3: 0000000034a4a000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	0f 85 0e 05 00 00    	jne    0x514
   6:	0f b6 9c 24 20 03 00 	movzbl 0x320(%rsp),%ebx
   d:	00
   e:	31 ff                	xor    %edi,%edi
  10:	89 de                	mov    %ebx,%esi
  12:	e8 68 9c ad ff       	call   0xffad9c7f
  17:	85 db                	test   %ebx,%ebx
  19:	0f 84 7b 01 00 00    	je     0x19a
  1f:	e8 5b 99 ad ff       	call   0xffad997f
  24:	e9 9e 00 00 00       	jmp    0xc7
* 29:	80 78 04 00          	cmpb   $0x0,0x4(%rax) <-- trapping instruction
  2d:	74 0a                	je     0x39
  2f:	bf 20 00 00 00       	mov    $0x20,%edi
  34:	e8 46 2d 15 00       	call   0x152d7f
  39:	4c                   	rex.WR
  3a:	8b                   	.byte 0x8b
  3b:	34 25                	xor    $0x25,%al
  3d:	20 00                	and    %al,(%rax)

Crashes (32):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/02 10:17 upstream acc4d5ff0b61 c799dfdd .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in sys_mremap
2025/04/02 10:01 upstream acc4d5ff0b61 c799dfdd .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in sys_mremap
2025/04/02 09:37 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in sys_mremap
2025/04/02 09:16 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in sys_mremap
2025/04/02 08:13 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in sys_mremap
2025/04/02 07:30 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in sys_mremap
2025/04/02 07:22 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in sys_mremap
2025/04/02 07:19 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in sys_mremap
2025/04/02 07:19 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in sys_mremap
2025/04/02 07:05 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in sys_mremap
2025/04/02 05:18 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in sys_mremap
2025/04/02 05:18 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in sys_mremap
2025/04/02 09:30 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in sys_mremap
2025/04/02 09:15 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in sys_mremap
2025/04/02 07:40 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in sys_mremap
2025/04/02 07:40 upstream acc4d5ff0b61 c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in sys_mremap
2025/04/02 01:45 upstream 91e5bfe317d8 c799dfdd .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in sys_mremap
2025/04/02 01:44 upstream 91e5bfe317d8 c799dfdd .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in sys_mremap
2025/04/02 01:43 upstream 91e5bfe317d8 c799dfdd .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in sys_mremap
2025/04/02 01:01 upstream 91e5bfe317d8 c799dfdd .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in sys_mremap
2025/03/31 16:12 linux-next 405e2241def8 d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/31 16:12 linux-next 405e2241def8 d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/31 16:12 linux-next 405e2241def8 d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/31 16:11 linux-next 405e2241def8 d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/31 16:07 linux-next 405e2241def8 d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/31 16:07 linux-next 405e2241def8 d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/28 20:26 linux-next e21edb1638e8 49900278 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/28 19:13 linux-next e21edb1638e8 49900278 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/28 13:08 linux-next e21edb1638e8 49900278 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/28 13:08 linux-next e21edb1638e8 49900278 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/28 10:30 linux-next e21edb1638e8 6c09fb82 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
2025/03/28 10:30 linux-next e21edb1638e8 6c09fb82 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in sys_mremap
* Struck through repros no longer work on HEAD.