syzbot


divide error in drm_mode_convert_to_umode

Status: upstream: reported C repro on 2024/02/12 10:36
Subsystems: dri
[Documentation on labels]
Reported-by: syzbot+0d7a3627fb6a42cf0863@syzkaller.appspotmail.com
First crash: 64d, last: 38d
Cause bisection: introduced by (bisect log) :
commit ea40d7857d5250e5400f38c69ef9e17321e9c4a2
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Fri Oct 9 23:21:56 2020 +0000

  drm/vkms: fbdev emulation support

Crash: divide error in drm_mode_vrefresh (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] Monthly dri report (Mar 2024) 0 (1) 2024/03/05 11:09
[PATCH] Test divide err in drm 1 (2) 2024/02/12 12:30
[syzbot] [dri?] divide error in drm_mode_convert_to_umode 0 (2) 2024/02/12 12:02
Last patch testing requests (3)
Created Duration User Patch Repo Result
2024/03/23 09:08 25m retest repro linux-next error OK
2024/03/08 11:11 14m retest repro upstream report log
2024/02/12 12:07 21m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master OK log

Sample crash report:
divide error: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 PID: 5074 Comm: syz-executor121 Not tainted 6.8.0-rc5-syzkaller-00121-g1c892cdd8fe0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
RIP: 0010:drm_mode_vrefresh drivers/gpu/drm/drm_modes.c:1303 [inline]
RIP: 0010:drm_mode_convert_to_umode+0x36a/0xbf0 drivers/gpu/drm/drm_modes.c:2594
Code: 0f b7 03 66 83 f8 02 b9 01 00 00 00 0f 43 c8 0f b7 c1 44 0f af f8 44 89 f0 48 69 c8 e8 03 00 00 44 89 f8 d1 e8 48 01 c8 31 d2 <49> f7 f7 48 89 c3 eb 1a e8 e9 2e 4b fc eb 05 e8 e2 2e 4b fc 48 8b
RSP: 0018:ffffc90003a5f660 EFLAGS: 00010246
RAX: 0000000000001f40 RBX: ffff8880234b2416 RCX: 0000000000001f40
RDX: 0000000000000000 RSI: ffffc90003a5f720 RDI: dffffc0000000000
RBP: 0000000000000200 R08: ffffffff85483dba R09: ffff8880234b240a
R10: dffffc0000000000 R11: ffffed1003de2579 R12: 1ffff11004696482
R13: ffff8880234b2400 R14: 0000000000000008 R15: 0000000000000000
FS:  0000555556c8e380(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffec5bfa610 CR3: 0000000011538000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 drm_atomic_set_mode_for_crtc+0x14a/0x4a0 drivers/gpu/drm/drm_atomic_uapi.c:82
 __drm_atomic_helper_set_config+0x255/0xf80 drivers/gpu/drm/drm_atomic.c:1679
 drm_atomic_helper_set_config+0x8b/0x150 drivers/gpu/drm/drm_atomic_helper.c:3263
 drm_mode_setcrtc+0xbb0/0x1780 drivers/gpu/drm/drm_crtc.c:886
 drm_ioctl_kernel+0x33a/0x440 drivers/gpu/drm/drm_ioctl.c:744
 drm_ioctl+0x639/0xb10 drivers/gpu/drm/drm_ioctl.c:841
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:857
 do_syscall_64+0xf9/0x240
 entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7fd93248b7e9
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:00007ffec5bfb618 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffec5bfb7e8 RCX: 00007fd93248b7e9
RDX: 0000000020000400 RSI: 00000000c06864a2 RDI: 0000000000000003
RBP: 00007fd9324fe610 R08: 0000000000000005 R09: 00007ffec5bfb7e8
R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffec5bfb7d8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:drm_mode_vrefresh drivers/gpu/drm/drm_modes.c:1303 [inline]
RIP: 0010:drm_mode_convert_to_umode+0x36a/0xbf0 drivers/gpu/drm/drm_modes.c:2594
Code: 0f b7 03 66 83 f8 02 b9 01 00 00 00 0f 43 c8 0f b7 c1 44 0f af f8 44 89 f0 48 69 c8 e8 03 00 00 44 89 f8 d1 e8 48 01 c8 31 d2 <49> f7 f7 48 89 c3 eb 1a e8 e9 2e 4b fc eb 05 e8 e2 2e 4b fc 48 8b
RSP: 0018:ffffc90003a5f660 EFLAGS: 00010246
RAX: 0000000000001f40 RBX: ffff8880234b2416 RCX: 0000000000001f40
RDX: 0000000000000000 RSI: ffffc90003a5f720 RDI: dffffc0000000000
RBP: 0000000000000200 R08: ffffffff85483dba R09: ffff8880234b240a
R10: dffffc0000000000 R11: ffffed1003de2579 R12: 1ffff11004696482
R13: ffff8880234b2400 R14: 0000000000000008 R15: 0000000000000000
FS:  0000555556c8e380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005fdeb8 CR3: 0000000011538000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	0f b7 03             	movzwl (%rbx),%eax
   3:	66 83 f8 02          	cmp    $0x2,%ax
   7:	b9 01 00 00 00       	mov    $0x1,%ecx
   c:	0f 43 c8             	cmovae %eax,%ecx
   f:	0f b7 c1             	movzwl %cx,%eax
  12:	44 0f af f8          	imul   %eax,%r15d
  16:	44 89 f0             	mov    %r14d,%eax
  19:	48 69 c8 e8 03 00 00 	imul   $0x3e8,%rax,%rcx
  20:	44 89 f8             	mov    %r15d,%eax
  23:	d1 e8                	shr    %eax
  25:	48 01 c8             	add    %rcx,%rax
  28:	31 d2                	xor    %edx,%edx
* 2a:	49 f7 f7             	div    %r15 <-- trapping instruction
  2d:	48 89 c3             	mov    %rax,%rbx
  30:	eb 1a                	jmp    0x4c
  32:	e8 e9 2e 4b fc       	call   0xfc4b2f20
  37:	eb 05                	jmp    0x3e
  39:	e8 e2 2e 4b fc       	call   0xfc4b2f20
  3e:	48                   	rex.W
  3f:	8b                   	.byte 0x8b

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/02/23 09:46 upstream 1c892cdd8fe0 8d446f15 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce divide error in drm_mode_convert_to_umode
2024/02/11 15:51 linux-next 445a555e0623 77b23aa1 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root divide error in drm_mode_convert_to_umode
2024/02/11 15:23 linux-next 445a555e0623 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root divide error in drm_mode_convert_to_umode
* Struck through repros no longer work on HEAD.