linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BUG: unable to handle kernel paging request in imageblit
@ 2021-09-13  3:06 Hao Sun
  0 siblings, 0 replies; 3+ messages in thread
From: Hao Sun @ 2021-09-13  3:06 UTC (permalink / raw)
  To: dri-devel, linux-fbdev; +Cc: linux-kernel

Hello,

When using Healer to fuzz the Linux kernel, the following crash was triggered.

HEAD commit: ac08b1c68d1b Merge tag 'pci-v5.15-changes'
git tree: upstream
console output:
https://drive.google.com/file/d/1Vvyiebkb1BAbgnM8QXg4XeotLYE7Xrk6/view?usp=sharing
kernel config: https://drive.google.com/file/d/1qrJUXD8ZIeAkg-xojzDpp04v9MtQ8RR6/view?usp=sharing
C reproducer: https://drive.google.com/file/d/1p79Nwcx6l7pC0qLZnbHFvr5FLSR79x0J/view?usp=sharing
Syzlang reproducer:
https://drive.google.com/file/d/1MT6DvJG2lMonmimV6XbED-I_STFMvaFo/view?usp=sharing

If you fix this issue, please add the following tag to the commit:
Reported-by: Hao Sun <sunhao.th@gmail.com>

BUG: unable to handle page fault for address: ffffc90007731480
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 8c00067 P4D 8c00067 PUD 8d63067 PMD 1026f8067 PTE 0
Oops: 0002 [#1] PREEMPT SMP
CPU: 0 PID: 10837 Comm: syz-executor Not tainted 5.14.0+ #15
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
RIP: 0010:fast_imageblit drivers/video/fbdev/core/sysimgblt.c:229 [inline]
RIP: 0010:sys_imageblit+0x48c/0x830 drivers/video/fbdev/core/sysimgblt.c:275
Code: 04 41 0f be 5d 00 83 fd 1f 0f 87 75 03 00 00 e8 5a d5 f9 fe 89
e9 8b 44 24 14 d3 fb 23 5c 24 08 41 23 04 9f 33 44 24 04 85 ed <41> 89
44 24 fc 75 b9 e8 38 d5 f9 fe 49 83 c5 01 bd 08 00 00 00 e8
RSP: 0018:ffffc9000928f890 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000007
RDX: 0000000000040000 RSI: ffffffff823dbcd6 RDI: ffffc9000928f9f0
RBP: 0000000000000007 R08: 0000000000000018 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000002 R12: ffffc90007731484
R13: ffff88810496f13c R14: ffffc90007731500 R15: ffffffff849e52c0
FS:  00007fef7bf33700(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90007731480 CR3: 000000001ef3e000 CR4: 0000000000750ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
 drm_fb_helper_sys_imageblit+0x18/0x40 drivers/gpu/drm/drm_fb_helper.c:794
 drm_fbdev_fb_imageblit+0x4b/0xa0 drivers/gpu/drm/drm_fb_helper.c:2276
 bit_putcs_unaligned drivers/video/fbdev/core/bitblit.c:139 [inline]
 bit_putcs+0x33c/0x590 drivers/video/fbdev/core/bitblit.c:188
 fbcon_putcs+0x13f/0x1a0 drivers/video/fbdev/core/fbcon.c:1296
 do_update_region+0x163/0x230 drivers/tty/vt/vt.c:676
 invert_screen+0x105/0x280 drivers/tty/vt/vt.c:800
 highlight drivers/tty/vt/selection.c:57 [inline]
 clear_selection+0x48/0x60 drivers/tty/vt/selection.c:84
 vc_do_resize+0x60b/0x6f0 drivers/tty/vt/vt.c:1257
 fbcon_do_set_font+0x188/0x2a0 drivers/video/fbdev/core/fbcon.c:2397
 fbcon_set_font+0x333/0x450 drivers/video/fbdev/core/fbcon.c:2483
 con_font_set drivers/tty/vt/vt.c:4666 [inline]
 con_font_op+0x238/0x4b0 drivers/tty/vt/vt.c:4710
 vt_k_ioctl drivers/tty/vt/vt_ioctl.c:474 [inline]
 vt_ioctl+0xd05/0x1890 drivers/tty/vt/vt_ioctl.c:752
 tty_ioctl+0x114/0xb00 drivers/tty/tty_io.c:2805
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0xb6/0x100 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x34/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x46a9a9
Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fef7bf32c58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 000000000078c0a0 RCX: 000000000046a9a9
RDX: 0000000020000080 RSI: 0000000000004b72 RDI: 0000000000000004
RBP: 00000000004e4042 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078c0a0
R13: 0000000000000000 R14: 000000000078c0a0 R15: 00007fff66610a60
Modules linked in:
Dumping ftrace buffer:
   (ftrace buffer empty)
CR2: ffffc90007731480
---[ end trace b77be2f6638c5c66 ]---
RIP: 0010:fast_imageblit drivers/video/fbdev/core/sysimgblt.c:229 [inline]
RIP: 0010:sys_imageblit+0x48c/0x830 drivers/video/fbdev/core/sysimgblt.c:275
Code: 04 41 0f be 5d 00 83 fd 1f 0f 87 75 03 00 00 e8 5a d5 f9 fe 89
e9 8b 44 24 14 d3 fb 23 5c 24 08 41 23 04 9f 33 44 24 04 85 ed <41> 89
44 24 fc 75 b9 e8 38 d5 f9 fe 49 83 c5 01 bd 08 00 00 00 e8
RSP: 0018:ffffc9000928f890 EFLAGS: 00010202
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000007
RDX: 0000000000040000 RSI: ffffffff823dbcd6 RDI: ffffc9000928f9f0
RBP: 0000000000000007 R08: 0000000000000018 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000002 R12: ffffc90007731484
R13: ffff88810496f13c R14: ffffc90007731500 R15: ffffffff849e52c0
FS:  00007fef7bf33700(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90007731480 CR3: 000000001ef3e000 CR4: 0000000000750ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
----------------
Code disassembly (best guess):
   0: 04 41                add    $0x41,%al
   2: 0f be 5d 00          movsbl 0x0(%rbp),%ebx
   6: 83 fd 1f              cmp    $0x1f,%ebp
   9: 0f 87 75 03 00 00    ja     0x384
   f: e8 5a d5 f9 fe        callq  0xfef9d56e
  14: 89 e9                mov    %ebp,%ecx
  16: 8b 44 24 14          mov    0x14(%rsp),%eax
  1a: d3 fb                sar    %cl,%ebx
  1c: 23 5c 24 08          and    0x8(%rsp),%ebx
  20: 41 23 04 9f          and    (%r15,%rbx,4),%eax
  24: 33 44 24 04          xor    0x4(%rsp),%eax
  28: 85 ed                test   %ebp,%ebp
* 2a: 41 89 44 24 fc        mov    %eax,-0x4(%r12) <-- trapping instruction
  2f: 75 b9                jne    0xffffffea
  31: e8 38 d5 f9 fe        callq  0xfef9d56e
  36: 49 83 c5 01          add    $0x1,%r13
  3a: bd 08 00 00 00        mov    $0x8,%ebp
  3f: e8                    .byte 0xe8

^ permalink raw reply	[flat|nested] 3+ messages in thread

* BUG: unable to handle kernel paging request in imageblit
@ 2022-07-28  0:14 Dipanjan Das
  0 siblings, 0 replies; 3+ messages in thread
From: Dipanjan Das @ 2022-07-28  0:14 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, sean, airlied, daniel, dri-devel,
	linux-kernel
  Cc: syzkaller, fleischermarius, its.priyanka.bose

[-- Attachment #1: Type: text/plain, Size: 5867 bytes --]

Hi,

We would like to report the following bug which has been found by our
modified version of syzkaller.

======================================================
description: BUG: unable to handle kernel paging request in imageblit
affected file: drivers/gpu/drm/drm_fb_helper.c
kernel version: 5.4.206
kernel commit: 6584107915561f860b7b05dcca5c903dd62a308d
git tree: upstream
kernel config: https://syzkaller.appspot.com/text?tag=KernelConfig&x=1aab6d4187ddf667
crash reproducer: attached
======================================================
Crash log:
======================================================
BUG: unable to handle page fault for address: ffffc90000c19000
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 119554067 P4D 119554067 PUD 119555067 PMD 10be9f067 PTE 0
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 27220 Comm: syz-executor.4 Tainted: G           OE     5.4.206+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.13.0-1ubuntu1.1 04/01/2014
RIP: 0010:fast_imageblit drivers/video/fbdev/core/sysimgblt.c:229 [inline]
RIP: 0010:sys_imageblit+0x1137/0x16f0 drivers/video/fbdev/core/sysimgblt.c:275
Code: 24 18 23 18 4c 89 f0 48 c1 e8 03 33 5c 24 60 0f b6 14 30 4c 89
f0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 56 03 00 00 31 ff <41> 89
5f fc 44 89 e6 e8 0d 6f b2 fd 45 85 e4 75 0f e8 93 6d b2 fd
RSP: 0018:ffff8880824df250 EFLAGS: 00010246
RAX: 0000000000000003 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: dffffc0000000000 RDI: 0000000000000000
RBP: ffff88810f56c213 R08: ffff8880922f82c0 R09: 0000000000000008
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000007
R13: 0000000000000002 R14: ffffc90000c19000 R15: ffffc90000c19004
FS:  00007f9076748700(0000) GS:ffff88811a000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90000c19000 CR3: 0000000090190001 CR4: 0000000000162ef0
Call Trace:
 drm_fb_helper_sys_imageblit+0x1c/0x130 drivers/gpu/drm/drm_fb_helper.c:809
 bit_putcs_unaligned drivers/video/fbdev/core/bitblit.c:139 [inline]
 bit_putcs+0x904/0xd90 drivers/video/fbdev/core/bitblit.c:188
 fbcon_putcs+0x39c/0x4c0 drivers/video/fbdev/core/fbcon.c:1302
 fbcon_putc+0x86/0xb0 drivers/video/fbdev/core/fbcon.c:1312
 complement_pos+0x360/0x720 drivers/tty/vt/vt.c:817
 highlight_pointer drivers/tty/vt/selection.c:63 [inline]
 clear_selection+0x17/0x70 drivers/tty/vt/selection.c:83
 vc_do_resize+0x1026/0x13a0 drivers/tty/vt/vt.c:1253
 fbcon_do_set_font+0x579/0x9f0 drivers/video/fbdev/core/fbcon.c:2442
 fbcon_set_font+0xa43/0xda0 drivers/video/fbdev/core/fbcon.c:2542
 con_font_set drivers/tty/vt/vt.c:4591 [inline]
 con_font_op+0x75b/0xcc0 drivers/tty/vt/vt.c:4635
 vt_ioctl+0x1663/0x2580 drivers/tty/vt/vt_ioctl.c:898
 tty_ioctl+0xda5/0x14c0 drivers/tty/tty_io.c:2657
 vfs_ioctl fs/ioctl.c:47 [inline]
 file_ioctl fs/ioctl.c:510 [inline]
 do_vfs_ioctl+0xd30/0x1340 fs/ioctl.c:697
 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:714
 __do_sys_ioctl fs/ioctl.c:721 [inline]
 __se_sys_ioctl fs/ioctl.c:719 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:719
 do_syscall_64+0xf6/0x7b0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f90787974ed
Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 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:00007f9076747be8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f90788b5f60 RCX: 00007f90787974ed
RDX: 0000000020000480 RSI: 0000000000004b72 RDI: 0000000000000003
RBP: 00007f90788032e1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffed03d269f R14: 00007f90788b5f60 R15: 00007f9076747d80
Modules linked in: uio_ivshmem(OE) uio(E)
CR2: ffffc90000c19000
---[ end trace af2a9beecf656bf6 ]---
RIP: 0010:fast_imageblit drivers/video/fbdev/core/sysimgblt.c:229 [inline]
RIP: 0010:sys_imageblit+0x1137/0x16f0 drivers/video/fbdev/core/sysimgblt.c:275
Code: 24 18 23 18 4c 89 f0 48 c1 e8 03 33 5c 24 60 0f b6 14 30 4c 89
f0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 56 03 00 00 31 ff <41> 89
5f fc 44 89 e6 e8 0d 6f b2 fd 45 85 e4 75 0f e8 93 6d b2 fd
RSP: 0018:ffff8880824df250 EFLAGS: 00010246
RAX: 0000000000000003 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: dffffc0000000000 RDI: 0000000000000000
RBP: ffff88810f56c213 R08: ffff8880922f82c0 R09: 0000000000000008
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000007
R13: 0000000000000002 R14: ffffc90000c19000 R15: ffffc90000c19004
FS:  00007f9076748700(0000) GS:ffff88811a000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc90000c19000 CR3: 0000000090190001 CR4: 0000000000162ef0
----------------
Code disassembly (best guess):
   0: 24 18                and    $0x18,%al
   2: 23 18                and    (%rax),%ebx
   4: 4c 89 f0              mov    %r14,%rax
   7: 48 c1 e8 03          shr    $0x3,%rax
   b: 33 5c 24 60          xor    0x60(%rsp),%ebx
   f: 0f b6 14 30          movzbl (%rax,%rsi,1),%edx
  13: 4c 89 f0              mov    %r14,%rax
  16: 83 e0 07              and    $0x7,%eax
  19: 83 c0 03              add    $0x3,%eax
  1c: 38 d0                cmp    %dl,%al
  1e: 7c 08                jl     0x28
  20: 84 d2                test   %dl,%dl
  22: 0f 85 56 03 00 00    jne    0x37e
  28: 31 ff                xor    %edi,%edi
* 2a: 41 89 5f fc          mov    %ebx,-0x4(%r15) <-- trapping instruction
  2e: 44 89 e6              mov    %r12d,%esi
  31: e8 0d 6f b2 fd        callq  0xfdb26f43
  36: 45 85 e4              test   %r12d,%r12d
  39: 75 0f                jne    0x4a
  3b: e8 93 6d b2 fd        callq  0xfdb26dd3

-- 
Thanks and Regards,

Dipanjan

[-- Attachment #2: repro.c --]
[-- Type: text/x-csrc, Size: 5860 bytes --]

// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE 

#include <endian.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2)
{
	if (a0 == 0xc || a0 == 0xb) {
		char buf[128];
		sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2);
		return open(buf, O_RDWR, 0);
	} else {
		char buf[1024];
		char* hash;
		strncpy(buf, (char*)a0, sizeof(buf) - 1);
		buf[sizeof(buf) - 1] = 0;
		while ((hash = strchr(buf, '#'))) {
			*hash = '0' + (char)(a1 % 10);
			a1 /= 10;
		}
		return open(buf, a2, 0);
	}
}

uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff};

int main(void)
{
		syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
	syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
	syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
				intptr_t res = 0;
	res = -1;
res = syz_open_dev(0xc, 4, 1);
	if (res != -1)
		r[0] = res;
*(uint8_t*)0x20000000 = 2;
*(uint8_t*)0x20000001 = 2;
*(uint16_t*)0x20000002 = 0;
*(uint16_t*)0x20000004 = 0;
*(uint16_t*)0x20000006 = 0;
*(uint16_t*)0x20000008 = 0x300;
*(uint16_t*)0x2000000a = 0;
	syscall(__NR_ioctl, r[0], 0x541c, 0x20000000ul);
	res = -1;
res = syz_open_dev(0xc, 4, 1);
	if (res != -1)
		r[1] = res;
*(uint32_t*)0x20000480 = 0;
*(uint32_t*)0x20000484 = 0;
*(uint32_t*)0x20000488 = 3;
*(uint32_t*)0x2000048c = 0x1b;
*(uint32_t*)0x20000490 = 0x200;
*(uint64_t*)0x20000498 = 0x20000040;
memcpy((void*)0x20000040, "\x11\x6a\x9c\xaf\xf7\x3a\x85\x29\x62\x2e\x69\x8f\x1e\xf3\xfa\x4e\x3b\xb4\x95\x29\x22\x28\x7b\xf4\xd4\xdb\x58\x01\x0b\x0c\x93\x12\x7b\xd5\xa1\x8d\xbd\x09\xe7\xdf\x91\x90\xc1\x72\x96\x29\xd0\x0f\x2d\xc5\xc8\x4f\x82\xea\xec\xd3\x50\xc6\xca\x4e\x70\x46\x88\x19\xde\x14\xe3\xd0\xe4\x91\x5c\x5d\x8d\x6a\xbf\x71\xee\xd2\xd4\x06\x95\xc5\x5c\x78\x1d\xca\xf8\x0a\x4a\x26\x9e\x1c\x43\xc7\xed\x9e\xd5\xe5\xe3\x86\xa2\x90\x24\x2a\x8b\x00\x70\xa7\xc0\x09\x23\x41\x0a\xe2\xf9\x51\xad\x46\x59\x3b\xe8\xb5\x03\x00\x00\x00\xaf\xa7\xcd\x0f\xc2\xea\x46\xb4\x21\xa4\xaa\x74\x1c\x80\x85\xfd\x17\xd5\xd9\x9c\x82\x92\x59\x18\x29\x39\x01\x46\x1b\xf7\x08\x9c\x38\x0e\x12\x7f\x8d\xe6\x87\x58\x11\x32\xc7\x30\xde\xf2\x66\x54\x4b\xbb\xc6\x0d\x21\xe8\x9d\x64\x79\x5d\xe7\x9b\x55\xbb\x1e\xd9\xd8\x7a\xa9\xf3\xa3\xd5\x01\x05\x91\xf8\x6f\x6a\x52\x50\x38\xee\x6c\xd8\xe6\x92\x0c\x3f\x6e\xdb\xc4\x04\x16\xe0\x45\x35\xdb\x71\x88\x2a\xa5\x82\xde\x9f\x25\x5e\xaf\x5e\xc5\x74\xe4\x63\x3c\x8d\x41\x97\x17\x8d\xa4\x9d\xb2\xab\xb0\xc4\x39\x98\x31\x6b\xbf\x1d\xc6\x9a\x79\x0c\xc9\x5a\x93\x7e\x09\x78\xc5\x38\x29\x17\x04\xdf\x87\x69\xce\xe5\xb1\xf3\x02\x41\x92\x0a\x72\xef\xbc\xcc\xeb\x61\x30\xfa\x88\xdb\x0e\x50\x1e\x3f\x58\x87\x45\x9d\xb4\xb7\x7c\x15\x81\xf6\xd5\x8a\x3a\x1e\x47\x00\x18\x8a\x88\x47\x52\xb2\xaf\xc2\xc8\x0e\x7b\xc3\xc3\xfc\xe7\x84\xf6\x70\xaa\x01\x33\x1e\xee\x95\x4d\x0c\x93\xbb\x66\x45\xff\xf3\xe3\xfa\xfb\xd8\x28\xaa\x12\xb7\xe4\x96\xa5\xac\x39\x47\xa3\xee\xec\x9c\x74\xa0\x4a\x14\x34\x0c\x8a\xb6\x7c\x14\xab\x34\x40\x20\x99\x6f\x21\x13\x6b\x46\x9b\x8b\xe0\x95\x8d\x7e\x8b\xcc\x32\x49\x0b\x70\x74\xc5\xe3\x44\xe0\x0b\x6e\xd2\xe2\xeb\xf4\xc9\xa3\xac\x9b\x6f\x74\xd3\xd7\xe7\xd3\xef\x76\xc7\xa7\x89\xa9\x2d\xde\xed\x72\x19\xf0\xbf\xac\x7c\x7a\xce\x85\x8e\xc5\x43\x11\xce\x32\x0f\x12\x61\x5a\xcb\x40\x8d\x58\xc6\x2e\xa3\x63\x94\xdd\xf2\x1f\x0d\x47\xe0\x6e\x88\x15\x4b\xa2\x63\xd2\xa9\x50\xc1\x88\xc9\xcb\x99\xdd\x95\x05\xfa\x7d\xfa\xe0\x8e\xd8\xf6\x8f\xb8\x2e\x94\xcb\x8d\x2f\x1a\x36\xef\x6c\x3c\x9c\x5d\x22\x01\xfe\x53\x8b\x4e\x01\x30\x30\xd2\xf2\x87\x1a\xbb\x04\xd6\xc6\x71\xcb\x37\x8f\xd0\xda\x22\x03\x4f\x28\x0f\xa8\x15\xde\x50\xc4\x2f\x25\xc3\x93\xbc\xdc\xf7\x51\x70\xc7\xa0\xdd\x2b\x9b\x22\xa7\xea\xdf\xbb\x9b\x5e\xa2\xd3\x58\x84\x38\x5e\x20\x45\xbf\xe9\xf3\x88\x03\xda\xf1\x6f\x33\x71\xb3\x8a\xc1\x09\xf0\x8c\x49\x58\x24\x2a\x9d\x21\xa9\xe0\xc1\x2c\xaf\xb3\x5f\xd7\xf4\x39\xc1\xd0\xac\xbe\xc0\x37\xe8\x38\xcc\x3f\x67\x46\x13\xb7\x5f\xb3\x78\xd7\x9c\x5e\x76\x30\x6b\x5e\x7f\x84\x1d\x46\x28\x64\x68\x46\x9d\x0d\x05\x1f\x4a\x3b\xd5\x5b\x6f\x1e\xe3\xc1\x77\xcc\xa1\x56\x21\xc7\x1e\x06\x8b\x1d\xa2\x69\x3d\x28\x00\x2b\x00\xe3\x85\x02\x6f\x6b\x9a\x0d\x5b\x55\xcd\x0e\xb7\x1e\x1d\x5c\x37\x3e\x14\x54\x8b\x69\x25\x4d\xe6\xc5\xbc\xd9\x5b\xff\x09\x29\xd9\x34\x44\xc5\xb9\xa7\xf6\x0c\x8c\x04\x01\xc6\xf8\xd6\xf8\xbc\x3f\x8f\xdb\xf0\x44\x68\x6c\x5b\x74\xa9\xca\xb3\x5f\x56\x3a\x9e\x61\xca\x72\x01\x96\x7c\x08\x39\x86\x5c\xe5\x8b\x38\x79\x49\x30\x95\x54\xc2\x2a\xb5\x51\x0b\xa0\xb9\x13\xac\xcf\x7d\xec\x3e\x88\x0a\x22\x7a\x02\xf8\xf7\x64\xb1\x93\x11\x4a\x88\xad\xf4\xc6\x30\x60\x51\xe6\x74\xd9\xd4\x6b\x35\x80\x8b\x39\x12\xa7\x13\x63\xf8\x02\xd1\x79\x80\x0f\x4f\x91\x8c\x7f\xec\x20\x2c\x35\x54\x7f\xea\xea\x7d\xca\xc7\xee\xb6\xca\x6e\x23\xc8\x99\x95\xc1\x6d\xef\xc0\xda\x19\xf0\x15\x1a\x07\xfa\x8d\x7d\xec\xfa\x09\x39\x66\xd7\x6f\x64\x7e\x93\xfc\xb6\x47\x14\x99\x0a\xe1\x79\x16\xce\xe2\xd0\x79\xfe\xa6\x6c\x2d\x1a\x8a\xf0\x3b\xb8\x42\xbe\x5b\x8b\x72\xf1\xe9\x4c\x91\x42\xb4\x56\x87\x6b\x26\xca\x89\x91\x7c\xb6\xd6\xb7\x2c\x7e\x3c\xce\x64\x93\x00\x40\x6a\x44\x28\x23\x6e\xa0\x12\x8f\x8f\x35\xe4\x30\x53\xa8\xce\x08\x8d\xfa\x59\x8b\xf3\x9b\xc8\xa6\x28\x5f\x2c\x83\x1e\x6b\xa2\xbe\xf3\x91\xc6\x3c\xe9\x69\x56\xb2\x89\x72\x52\x95\x34\xc4\x38\x79\x15\xd0\x1e\x51\xb5\x92\xad\x8e\xc8\x5d\x6a\x5d\x02\xe9\xd8\x75\xb8\x08\x4d\x0b\xbc\xcc\x3f\xf9\x05\x01\x01\xde\x57\x7d\x9e\x3d\x9b\xb8\xc6\x4b\xa4\xb4\xe5\x73\x6c\x5d\x89\xa3\x10\xfc\xce\x1e\xe9\x6f\x1f\xdd\x0a\xd4\xf8\xc5\x5c\xb1\xcd\x10\x0d\x8c\x77\x12\x95\xb7\x12\x29\x18\xd5\x43\xea\xbd\xf6\x78\x98\xa3\x36\x23\x23\xed\x8c\xad\xdd\x4f\x7b\x19\x5b\xb3\x5b\xe1\x09\x4e\xf2\x6e\xbe\x0b", 1024);
	syscall(__NR_ioctl, r[1], 0x4b72, 0x20000480ul);
	return 0;
}

[-- Attachment #3: repro.syz --]
[-- Type: application/octet-stream, Size: 2310 bytes --]

r0 = syz_open_dev$tty1(0xc, 0x4, 0x1)
ioctl$TIOCL_SETSEL(r0, 0x541c, &(0x7f0000000000)={0x2, {0x2, 0x0, 0x0, 0x0, 0x300}})
r1 = syz_open_dev$tty1(0xc, 0x4, 0x1)
ioctl$KDFONTOP_SET(r1, 0x4b72, &(0x7f0000000480)={0x0, 0x0, 0x3, 0x1b, 0x200, &(0x7f0000000040)="116a9caff73a8529622e698f1ef3fa4e3bb4952922287bf4d4db58010b0c93127bd5a18dbd09e7df9190c1729629d00f2dc5c84f82eaecd350c6ca4e70468819de14e3d0e4915c5d8d6abf71eed2d40695c55c781dcaf80a4a269e1c43c7ed9ed5e5e386a290242a8b0070a7c00923410ae2f951ad46593be8b503000000afa7cd0fc2ea46b421a4aa741c8085fd17d5d99c82925918293901461bf7089c380e127f8de687581132c730def266544bbbc60d21e89d64795de79b55bb1ed9d87aa9f3a3d5010591f86f6a525038ee6cd8e6920c3f6edbc40416e04535db71882aa582de9f255eaf5ec574e4633c8d4197178da49db2abb0c43998316bbf1dc69a790cc95a937e0978c538291704df8769cee5b1f30241920a72efbccceb6130fa88db0e501e3f5887459db4b77c1581f6d58a3a1e4700188a884752b2afc2c80e7bc3c3fce784f670aa01331eee954d0c93bb6645fff3e3fafbd828aa12b7e496a5ac3947a3eeec9c74a04a14340c8ab67c14ab344020996f21136b469b8be0958d7e8bcc32490b7074c5e344e00b6ed2e2ebf4c9a3ac9b6f74d3d7e7d3ef76c7a789a92ddeed7219f0bfac7c7ace858ec54311ce320f12615acb408d58c62ea36394ddf21f0d47e06e88154ba263d2a950c188c9cb99dd9505fa7dfae08ed8f68fb82e94cb8d2f1a36ef6c3c9c5d2201fe538b4e013030d2f2871abb04d6c671cb378fd0da22034f280fa815de50c42f25c393bcdcf75170c7a0dd2b9b22a7eadfbb9b5ea2d35884385e2045bfe9f38803daf16f3371b38ac109f08c4958242a9d21a9e0c12cafb35fd7f439c1d0acbec037e838cc3f674613b75fb378d79c5e76306b5e7f841d46286468469d0d051f4a3bd55b6f1ee3c177cca15621c71e068b1da2693d28002b00e385026f6b9a0d5b55cd0eb71e1d5c373e14548b69254de6c5bcd95bff0929d93444c5b9a7f60c8c0401c6f8d6f8bc3f8fdbf044686c5b74a9cab35f563a9e61ca7201967c0839865ce58b387949309554c22ab5510ba0b913accf7dec3e880a227a02f8f764b193114a88adf4c6306051e674d9d46b35808b3912a71363f802d179800f4f918c7fec202c35547feaea7dcac7eeb6ca6e23c89995c16defc0da19f0151a07fa8d7decfa093966d76f647e93fcb64714990ae17916cee2d079fea66c2d1a8af03bb842be5b8b72f1e94c9142b456876b26ca89917cb6d6b72c7e3cce649300406a4428236ea0128f8f35e43053a8ce088dfa598bf39bc8a6285f2c831e6ba2bef391c63ce96956b28972529534c4387915d01e51b592ad8ec85d6a5d02e9d875b8084d0bbccc3ff9050101de577d9e3d9bb8c64ba4b4e5736c5d89a310fcce1ee96f1fdd0ad4f8c55cb1cd100d8c771295b7122918d543eabdf67898a3362323ed8caddd4f7b195bb35be1094ef26ebe0b"})

^ permalink raw reply	[flat|nested] 3+ messages in thread

* BUG: unable to handle kernel paging request in imageblit
@ 2022-01-04 11:56 kvartet
  0 siblings, 0 replies; 3+ messages in thread
From: kvartet @ 2022-01-04 11:56 UTC (permalink / raw)
  To: dri-devel, linux-fbdev, linux-kernel, syzkaller-bugs; +Cc: sunhao.th

Hello,

When using Syzkaller to fuzz the latest Linux kernel, the following
crash was triggered.

HEAD commit: a7904a538933 Linux 5.16-rc6
git tree: upstream
console output: https://paste.ubuntu.com/p/Rvt9f7wByG/plain/
kernel config: https://paste.ubuntu.com/p/FDDNHDxtwz/plain/
C reproducer: https://paste.ubuntu.com/p/KzH8Wx9H9R/plain/
Syzlang reproducer: https://paste.ubuntu.com/p/cDfk6NK4S4/plain/

If you fix this issue, please add the following tag to the commit:
Reported-by: Yiru Xu <xyru1999@gmail.com>


BUG: unable to handle page fault for address: fffff520009cf200
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 13ffed067 P4D 13ffed067 PUD 10dba067 PMD 18fd2067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 19972 Comm: syz-executor.5 Not tainted 5.16.0-rc6 #9
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.13.0-1ubuntu1.1 04/01/2014
RIP: 0010:fast_imageblit drivers/video/fbdev/core/sysimgblt.c:229 [inline]
RIP: 0010:sys_imageblit+0x650/0x13f0 drivers/video/fbdev/core/sysimgblt.c:275
Code: 03 38 d0 7c 08 84 d2 0f 85 44 0d 00 00 48 bf 00 00 00 00 00 fc
ff df 8b 44 24 30 23 03 8b 5c 24 20 31 c3 4c 89 f0 48 c1 e8 03 <0f> b6
14 38 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 01
RSP: 0018:ffffc9000324f330 EFLAGS: 00010216
RAX: 1ffff920009cf200 RBX: 0000000000000000 RCX: 0000000000000007
RDX: 0000000000000000 RSI: dffffc0000000000 RDI: dffffc0000000000
RBP: ffff8880198c4000 R08: ffffffff841fac07 R09: 000000000000001f
R10: 0000000000000005 R11: fffffbfff1b20a42 R12: 0000000000000007
R13: 000000000000094b R14: ffffc90004e79000 R15: ffffc90004e79004
FS:  00007f59ce6a3700(0000) GS:ffff888135c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffff520009cf200 CR3: 000000010d39f000 CR4: 0000000000350ee0
Call Trace:
 <TASK>
 drm_fb_helper_sys_imageblit+0x1c/0x180 drivers/gpu/drm/drm_fb_helper.c:794
 drm_fbdev_fb_imageblit+0x179/0x260 drivers/gpu/drm/drm_fb_helper.c:2288
 bit_putcs_unaligned drivers/video/fbdev/core/bitblit.c:124 [inline]
 bit_putcs+0x8ed/0xd80 drivers/video/fbdev/core/bitblit.c:173
 fbcon_putcs+0x367/0x450 drivers/video/fbdev/core/fbcon.c:1277
 do_update_region+0x399/0x630 drivers/tty/vt/vt.c:676
 invert_screen+0x2a7/0x610 drivers/tty/vt/vt.c:800
 highlight drivers/tty/vt/selection.c:57 [inline]
 clear_selection drivers/tty/vt/selection.c:84 [inline]
 clear_selection+0x55/0x70 drivers/tty/vt/selection.c:80
 vc_do_resize+0xda8/0x10a0 drivers/tty/vt/vt.c:1257
 fbcon_do_set_font+0x472/0x770 drivers/video/fbdev/core/fbcon.c:1928
 fbcon_set_font+0x80f/0xa00 drivers/video/fbdev/core/fbcon.c:2014
 con_font_set drivers/tty/vt/vt.c:4666 [inline]
 con_font_op+0x73a/0xca0 drivers/tty/vt/vt.c:4710
 vt_k_ioctl drivers/tty/vt/vt_ioctl.c:474 [inline]
 vt_ioctl+0x1de9/0x2af0 drivers/tty/vt/vt_ioctl.c:752
 tty_ioctl+0xc80/0x1450 drivers/tty/tty_io.c:2805
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f59cfd3189d
Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f59ce6a2c28 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f59cfe50f60 RCX: 00007f59cfd3189d
RDX: 0000000020000080 RSI: 0000000000004b72 RDI: 0000000000000005
RBP: 00007f59cfd9e00d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd4f88b4ff R14: 00007f59cfe50f60 R15: 00007f59ce6a2dc0
 </TASK>
Modules linked in:
CR2: fffff520009cf200
---[ end trace 4fd686b04a4d7413 ]---
RIP: 0010:fast_imageblit drivers/video/fbdev/core/sysimgblt.c:229 [inline]
RIP: 0010:sys_imageblit+0x650/0x13f0 drivers/video/fbdev/core/sysimgblt.c:275
Code: 03 38 d0 7c 08 84 d2 0f 85 44 0d 00 00 48 bf 00 00 00 00 00 fc
ff df 8b 44 24 30 23 03 8b 5c 24 20 31 c3 4c 89 f0 48 c1 e8 03 <0f> b6
14 38 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 01
RSP: 0018:ffffc9000324f330 EFLAGS: 00010216
RAX: 1ffff920009cf200 RBX: 0000000000000000 RCX: 0000000000000007
RDX: 0000000000000000 RSI: dffffc0000000000 RDI: dffffc0000000000
RBP: ffff8880198c4000 R08: ffffffff841fac07 R09: 000000000000001f
R10: 0000000000000005 R11: fffffbfff1b20a42 R12: 0000000000000007
R13: 000000000000094b R14: ffffc90004e79000 R15: ffffc90004e79004
FS:  00007f59ce6a3700(0000) GS:ffff888135c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffff520009cf200 CR3: 000000010d39f000 CR4: 0000000000350ee0
----------------
Code disassembly (best guess), 1 bytes skipped:
   0: 38 d0                cmp    %dl,%al
   2: 7c 08                jl     0xc
   4: 84 d2                test   %dl,%dl
   6: 0f 85 44 0d 00 00    jne    0xd50
   c: 48 bf 00 00 00 00 00 movabs $0xdffffc0000000000,%rdi
  13: fc ff df
  16: 8b 44 24 30          mov    0x30(%rsp),%eax
  1a: 23 03                and    (%rbx),%eax
  1c: 8b 5c 24 20          mov    0x20(%rsp),%ebx
  20: 31 c3                xor    %eax,%ebx
  22: 4c 89 f0              mov    %r14,%rax
  25: 48 c1 e8 03          shr    $0x3,%rax
* 29: 0f b6 14 38          movzbl (%rax,%rdi,1),%edx <-- trapping instruction
  2d: 4c 89 f0              mov    %r14,%rax
  30: 83 e0 07              and    $0x7,%eax
  33: 83 c0 03              add    $0x3,%eax
  36: 38 d0                cmp    %dl,%al
  38: 7c 08                jl     0x42
  3a: 84 d2                test   %dl,%dl
  3c: 0f                    .byte 0xf
  3d: 85 01                test   %eax,(%rcx)

Best Regards,
Yiru

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-28  0:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13  3:06 BUG: unable to handle kernel paging request in imageblit Hao Sun
2022-01-04 11:56 kvartet
2022-07-28  0:14 Dipanjan Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).