syzbot


general protection fault in follow_pfnmap_start

Status: upstream: reported C repro on 2024/10/01 09:37
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+093d096417e7038a689b@syzkaller.appspotmail.com
Fix commit: mm: fix null pointer dereference in pfnmap_lockdep_assert
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: 73d, last: 55d
Discussions (5)
Title Replies (including bot) Last reply
[PATCH v3] Fixes: null pointer dereference in pfnmap_lockdep_assert 6 (6) 2024/10/08 19:27
[PATCH v4] Fixes: null pointer dereference in pfnmap_lockdep_assert 2 (2) 2024/10/07 13:25
[PATCH v2] Fixes: null pointer dereference in pfnmap_lockdep_assert 3 (3) 2024/10/04 13:27
[PATCH] Fixes: null pointer dereference in pfnmap_lockdep_assert 6 (6) 2024/10/04 12:29
[syzbot] [kernel?] general protection fault in follow_pfnmap_start 0 (1) 2024/10/01 09:37

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xdffffc000000000b: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000058-0x000000000000005f]
CPU: 0 UID: 0 PID: 5102 Comm: syz-executor119 Not tainted 6.11.0-syzkaller-11558-g075dbe9f6e3c #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:pfnmap_lockdep_assert mm/memory.c:6349 [inline]
RIP: 0010:follow_pfnmap_start+0x1a7/0xfd0 mm/memory.c:6402
Code: 8d 9f 80 00 00 00 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 57 0c 1a 00 48 8b 1b 48 83 c3 58 48 89 d8 48 c1 e8 03 <42> 80 3c 20 00 74 08 48 89 df e8 3a 0c 1a 00 4c 8b 23 48 c7 c0 7c
RSP: 0018:ffffc9000179f100 EFLAGS: 00010202
RAX: 000000000000000b RBX: 0000000000000058 RCX: ffff88801aa0c880
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc9000179f1e0
RBP: ffffc9000179f290 R08: ffffc9000179f311 R09: 0000000000000000
R10: ffffc9000179f2f0 R11: fffff520002f3e63 R12: dffffc0000000000
R13: 1ffff110023c0202 R14: ffffc9000179f2e0 R15: ffff888011e01000
FS:  0000555593c58380(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f9ad1af10f0 CR3: 000000001270e000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 follow_phys arch/x86/mm/pat/memtype.c:956 [inline]
 get_pat_info+0x182/0x3f0 arch/x86/mm/pat/memtype.c:988
 untrack_pfn+0x327/0x640 arch/x86/mm/pat/memtype.c:1101
 unmap_single_vma+0x1f6/0x2b0 mm/memory.c:1834
 unmap_vmas+0x3cc/0x5f0 mm/memory.c:1900
 unmap_region+0x214/0x380 mm/vma.c:354
 mmap_region+0x22f9/0x2990 mm/mmap.c:1573
 do_mmap+0x8f0/0x1000 mm/mmap.c:496
 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588
 ksys_mmap_pgoff+0x4eb/0x720 mm/mmap.c:542
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9ad1a7a879
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 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:00007ffd49b2ee58 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9ad1a7a879
RDX: 0000000000000007 RSI: 0000000000005000 RDI: 0000000020371000
RBP: 00007f9ad1aed5f0 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000000011 R11: 0000000000000246 R12: 0000000000000001
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:pfnmap_lockdep_assert mm/memory.c:6349 [inline]
RIP: 0010:follow_pfnmap_start+0x1a7/0xfd0 mm/memory.c:6402
Code: 8d 9f 80 00 00 00 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 57 0c 1a 00 48 8b 1b 48 83 c3 58 48 89 d8 48 c1 e8 03 <42> 80 3c 20 00 74 08 48 89 df e8 3a 0c 1a 00 4c 8b 23 48 c7 c0 7c
RSP: 0018:ffffc9000179f100 EFLAGS: 00010202
RAX: 000000000000000b RBX: 0000000000000058 RCX: ffff88801aa0c880
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc9000179f1e0
RBP: ffffc9000179f290 R08: ffffc9000179f311 R09: 0000000000000000
R10: ffffc9000179f2f0 R11: fffff520002f3e63 R12: dffffc0000000000
R13: 1ffff110023c0202 R14: ffffc9000179f2e0 R15: ffff888011e01000
FS:  0000555593c58380(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555593c58ca8 CR3: 000000001270e000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	8d 9f 80 00 00 00    	lea    0x80(%rdi),%ebx
   6:	48 89 d8             	mov    %rbx,%rax
   9:	48 c1 e8 03          	shr    $0x3,%rax
   d:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1)
  12:	74 08                	je     0x1c
  14:	48 89 df             	mov    %rbx,%rdi
  17:	e8 57 0c 1a 00       	call   0x1a0c73
  1c:	48 8b 1b             	mov    (%rbx),%rbx
  1f:	48 83 c3 58          	add    $0x58,%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	48 89 df             	mov    %rbx,%rdi
  34:	e8 3a 0c 1a 00       	call   0x1a0c73
  39:	4c 8b 23             	mov    (%rbx),%r12
  3c:	48                   	rex.W
  3d:	c7                   	.byte 0xc7
  3e:	c0                   	.byte 0xc0
  3f:	7c                   	.byte 0x7c

Crashes (38):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/27 10:31 upstream 075dbe9f6e3c 9314348a .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in follow_pfnmap_start
2024/09/27 09:59 upstream 075dbe9f6e3c 9314348a .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in follow_pfnmap_start
2024/10/15 17:58 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in follow_pfnmap_start
2024/10/15 17:58 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in follow_pfnmap_start
2024/10/15 16:11 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in follow_pfnmap_start
2024/10/15 16:11 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in follow_pfnmap_start
2024/10/15 15:59 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in follow_pfnmap_start
2024/10/15 12:41 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in follow_pfnmap_start
2024/10/15 12:41 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in follow_pfnmap_start
2024/10/15 12:41 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in follow_pfnmap_start
2024/10/09 06:26 upstream 5b7c893ed5ed 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in follow_pfnmap_start
2024/10/09 06:26 upstream 5b7c893ed5ed 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in follow_pfnmap_start
2024/10/03 09:00 upstream f23aa4c0761a a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in follow_pfnmap_start
2024/10/03 09:00 upstream f23aa4c0761a a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in follow_pfnmap_start
2024/10/03 02:58 upstream f23aa4c0761a a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in follow_pfnmap_start
2024/10/03 02:58 upstream f23aa4c0761a a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in follow_pfnmap_start
2024/10/02 11:39 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in follow_pfnmap_start
2024/10/02 11:39 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root general protection fault in follow_pfnmap_start
2024/10/02 03:32 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in follow_pfnmap_start
2024/10/02 03:32 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in follow_pfnmap_start
2024/10/02 02:17 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in follow_pfnmap_start
2024/10/02 02:17 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root general protection fault in follow_pfnmap_start
2024/10/01 20:57 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in follow_pfnmap_start
2024/10/01 20:57 upstream e32cde8d2bd7 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in follow_pfnmap_start
2024/10/15 13:38 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in follow_pfnmap_start
2024/10/15 13:38 upstream eca631b8fe80 14943bb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in follow_pfnmap_start
2024/10/03 04:22 upstream f23aa4c0761a a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in follow_pfnmap_start
2024/09/27 09:26 upstream 075dbe9f6e3c 9314348a .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in follow_pfnmap_start
2024/10/15 19:39 upstream eca631b8fe80 eddfb4c9 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in follow_pfnmap_start
2024/10/10 16:32 upstream d3d1556696c1 a156c552 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in follow_pfnmap_start
2024/10/09 20:42 upstream 75b607fab38d 56fb2cb7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in follow_pfnmap_start
2024/10/03 10:36 upstream f23aa4c0761a a4c7fd36 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in follow_pfnmap_start
2024/10/03 10:36 upstream f23aa4c0761a a4c7fd36 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in follow_pfnmap_start
2024/09/28 08:15 upstream e477dba5442c 440b26ec .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in follow_pfnmap_start
2024/10/03 19:54 linux-next c02d24a5af66 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in follow_pfnmap_start
2024/10/03 19:54 linux-next c02d24a5af66 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in follow_pfnmap_start
2024/10/01 22:21 linux-next 77df9e4bb222 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in follow_pfnmap_start
2024/10/01 22:21 linux-next 77df9e4bb222 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in follow_pfnmap_start
* Struck through repros no longer work on HEAD.