syzbot


kernel BUG in vmf_insert_pfn_prot (2)

Status: upstream: reported C repro on 2023/08/24 07:01
Subsystems: dri
[Documentation on labels]
Reported-by: syzbot+398e17b61dab22cc56bc@syzkaller.appspotmail.com
First crash: 195d, last: 13d
Cause bisection: introduced by (bisect log) :
commit 45d9c8dde4cd8589f9180309ec60f0da2ce486e4
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Thu Aug 12 13:14:12 2021 +0000

  drm/vgem: use shmem helpers

Crash: kernel BUG in vmf_insert_pfn_prot (log)
Repro: C syz .config
  
Discussions (4)
Title Replies (including bot) Last reply
[syzbot] Monthly dri report (Jan 2024) 0 (1) 2024/01/02 13:36
[syzbot] Monthly dri report (Nov 2023) 0 (1) 2023/11/30 20:33
[syzbot] [dri?] kernel BUG in vmf_insert_pfn_prot (2) 0 (3) 2023/11/08 14:46
[syzbot] Monthly dri report (Oct 2023) 0 (1) 2023/10/30 12:59
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 kernel BUG in vmf_insert_pfn_prot origin:lts-only C inconclusive 62 10d 349d 0/3 upstream: reported C repro on 2023/03/18 14:33
upstream kernel BUG in vmf_insert_pfn_prot C done done 1933 293d 897d 22/26 fixed on 2023/06/14 22:21
Last patch testing requests (11)
Created Duration User Patch Repo Result
2024/02/17 13:17 15m retest repro upstream report log
2024/02/17 13:17 16m retest repro upstream report log
2024/01/06 13:24 17m retest repro upstream report log
2024/01/06 13:24 18m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2024/01/06 13:24 27m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2023/12/23 11:09 14m retest repro upstream report log
2023/12/09 08:48 21m retest repro upstream report log
2023/12/09 08:48 16m retest repro upstream report log
2023/10/18 06:28 18m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2023/09/03 10:44 14m retest repro upstream report log
2023/08/24 23:36 18m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log
Cause bisection attempts (2)
Created Duration User Patch Repo Result
2023/11/08 08:08 6h37m bisect upstream job log (1) log
2023/10/24 07:18 2h02m bisect upstream error job log (0)

Sample crash report:
------------[ cut here ]------------
kernel BUG at mm/memory.c:2216!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5067 Comm: syz-executor340 Not tainted 6.6.0-syzkaller-14651-gd2f51b3516da #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
RIP: 0010:vmf_insert_pfn_prot+0x247/0x430 mm/memory.c:2216
Code: 0f 0b e8 7c e6 bd ff 49 89 ef bf 20 00 00 00 41 83 e7 28 4c 89 fe e8 f8 e1 bd ff 49 83 ff 20 0f 85 aa fe ff ff e8 59 e6 bd ff <0f> 0b 48 bd ff ff ff ff ff ff 0f 00 e8 48 e6 bd ff 4c 89 f6 48 89
RSP: 0018:ffffc90003bbf758 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88802847ec00 RCX: ffffffff81cab618
RDX: ffff888015bd1dc0 RSI: ffffffff81cab627 RDI: 0000000000000007
RBP: 000000000c040474 R08: 0000000000000007 R09: 0000000000000020
R10: 0000000000000020 R11: 0000000000000009 R12: 0000000020ffd000
R13: 1ffff92000777eec R14: 000000000001e529 R15: 0000000000000020
FS:  0000555555e2a480(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020ffd000 CR3: 000000002aae7000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 drm_gem_shmem_fault+0x207/0x400 drivers/gpu/drm/drm_gem_shmem_helper.c:531
 __do_fault+0x107/0x5f0 mm/memory.c:4265
 do_read_fault mm/memory.c:4628 [inline]
 do_fault mm/memory.c:4762 [inline]
 do_pte_missing mm/memory.c:3730 [inline]
 handle_pte_fault mm/memory.c:5038 [inline]
 __handle_mm_fault+0x2682/0x3d60 mm/memory.c:5179
 handle_mm_fault+0x478/0xa00 mm/memory.c:5344
 do_user_addr_fault+0x3d1/0x1000 arch/x86/mm/fault.c:1413
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x5c/0xd0 arch/x86/mm/fault.c:1561
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0010:rep_movs_alternative+0x4a/0x70 arch/x86/lib/copy_user_64.S:71
Code: 75 f1 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 8b 06 48 89 07 48 83 c6 08 48 83 c7 08 83 e9 08 74 df 83 f9 08 73 e8 eb c9 <f3> a4 c3 48 89 c8 48 c1 e9 03 83 e0 07 f3 48 a5 89 c1 85 c9 75 b3
RSP: 0018:ffffc90003bbfb50 EFLAGS: 00050206
RAX: 0000000000000001 RBX: 0000000020ffd000 RCX: 0000000000001000
RDX: 0000000000000000 RSI: 0000000020ffd000 RDI: ffff888018796000
RBP: 0000000000001000 R08: 0000000000000001 R09: ffffed10030f2dff
R10: ffff888018796fff R11: 0000000000000000 R12: 0000000020ffe000
R13: ffff888018796000 R14: 0000000000000000 R15: 0000000020ffd000
 copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline]
 raw_copy_from_user arch/x86/include/asm/uaccess_64.h:127 [inline]
 _copy_from_user+0xc2/0xf0 lib/usercopy.c:23
 copy_from_user include/linux/uaccess.h:183 [inline]
 snd_rawmidi_kernel_write1+0x360/0x860 sound/core/rawmidi.c:1618
 snd_rawmidi_write+0x26e/0xc00 sound/core/rawmidi.c:1687
 vfs_write+0x2a4/0xdf0 fs/read_write.c:582
 ksys_write+0x1f0/0x250 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f31add88d69
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:00007ffdd9a49ee8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffdd9a49f00 RCX: 00007f31add88d69
RDX: 00000000fffffd2c RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007ffdd9a49f08 R08: 0000000000000000 R09: 0000000000000000
R10: 00007ffdd9a49f08 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffdd9a4a168 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:vmf_insert_pfn_prot+0x247/0x430 mm/memory.c:2216
Code: 0f 0b e8 7c e6 bd ff 49 89 ef bf 20 00 00 00 41 83 e7 28 4c 89 fe e8 f8 e1 bd ff 49 83 ff 20 0f 85 aa fe ff ff e8 59 e6 bd ff <0f> 0b 48 bd ff ff ff ff ff ff 0f 00 e8 48 e6 bd ff 4c 89 f6 48 89
RSP: 0018:ffffc90003bbf758 EFLAGS: 00010293
RAX: 0000000000000000 RBX: ffff88802847ec00 RCX: ffffffff81cab618
RDX: ffff888015bd1dc0 RSI: ffffffff81cab627 RDI: 0000000000000007
RBP: 000000000c040474 R08: 0000000000000007 R09: 0000000000000020
R10: 0000000000000020 R11: 0000000000000009 R12: 0000000020ffd000
R13: 1ffff92000777eec R14: 000000000001e529 R15: 0000000000000020
FS:  0000555555e2a480(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020acb000 CR3: 000000002aae7000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	75 f1                	jne    0xfffffff3
   2:	c3                   	ret
   3:	66 66 2e 0f 1f 84 00 	data16 cs nopw 0x0(%rax,%rax,1)
   a:	00 00 00 00
   e:	66 90                	xchg   %ax,%ax
  10:	48 8b 06             	mov    (%rsi),%rax
  13:	48 89 07             	mov    %rax,(%rdi)
  16:	48 83 c6 08          	add    $0x8,%rsi
  1a:	48 83 c7 08          	add    $0x8,%rdi
  1e:	83 e9 08             	sub    $0x8,%ecx
  21:	74 df                	je     0x2
  23:	83 f9 08             	cmp    $0x8,%ecx
  26:	73 e8                	jae    0x10
  28:	eb c9                	jmp    0xfffffff3
* 2a:	f3 a4                	rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction
  2c:	c3                   	ret
  2d:	48 89 c8             	mov    %rcx,%rax
  30:	48 c1 e9 03          	shr    $0x3,%rcx
  34:	83 e0 07             	and    $0x7,%eax
  37:	f3 48 a5             	rep movsq %ds:(%rsi),%es:(%rdi)
  3a:	89 c1                	mov    %eax,%ecx
  3c:	85 c9                	test   %ecx,%ecx
  3e:	75 b3                	jne    0xfffffff3

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/06 23:24 upstream d2f51b3516da 78fae24e .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce kernel BUG in vmf_insert_pfn_prot
2023/11/25 08:43 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8de1e7afcc1c 5b429f39 .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 kernel BUG in vmf_insert_pfn_prot
2023/11/22 08:18 upstream c2d5304e6c64 cb976f63 .config strace log report syz [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root kernel BUG in vmf_insert_pfn_prot
2023/11/15 14:49 upstream c42d9eeef8e5 cb976f63 .config strace log report syz [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in vmf_insert_pfn_prot
2023/08/20 07:32 upstream 9e6c269de404 d216d8a0 .config strace log report syz [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce kernel BUG in vmf_insert_pfn_prot
2023/10/04 06:05 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 2e530aeb342b 65faba36 .config console log report syz [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 kernel BUG in vmf_insert_pfn_prot
2024/01/09 21:46 upstream 9f8413c4a66f b438bd66 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in vmf_insert_pfn_prot
2023/11/17 06:46 upstream 7475e51b8796 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root kernel BUG in vmf_insert_pfn_prot
2023/11/06 22:35 upstream d2f51b3516da 78fae24e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce kernel BUG in vmf_insert_pfn_prot
2023/08/20 06:58 upstream 9e6c269de404 d216d8a0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce kernel BUG in vmf_insert_pfn_prot
* Struck through repros no longer work on HEAD.